jenkinsci / jenkinsci/workflow-basic-steps-plugin

[JENKINS-52807] Throw a more specific error when the timeout step times out

Offen
#466 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
component:workflow-basic-steps-plugin imported-jira-issue priority:minor resolution:unresolved
Vorherrschende Sprache
Java
Sterne
73
Forks
129
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

We ended up having to wrap the timeout step to make it more informative when the timeout occurs.

When the call to timeout throws an error, we determine whether the duration the step took was longer than the timeout. If it took longer, we throw a different TimeoutException which states the time taken and the step being executed, so that someone reading the build log can figure out whether the failure was a timeout or not, and which step took too long.

Unfortunately, there is an edge case where the step takes just longer than the timeout, where it is possible for the step to take slightly too long, but not actually fail due to the timeout. In this situation, we can't tell the difference.

The timeout step itself seems to know when it interrupted the step, so it could do this for us in a much more precise way.

---
Originally reported by trejkaz, imported from: Throw a more specific error when the timeout step times out


  • status: Open
  • priority: Minor
  • component(s): workflow-basic-steps-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 20251215-220547

Raw content of original issue

We ended up having to wrap the timeout step to make it more informative when the timeout occurs.

When the call to timeout throws an error, we determine whether the duration the step took was longer than the timeout. If it took longer, we throw a different TimeoutException which states the time taken and the step being executed, so that someone reading the build log can figure out whether the failure was a timeout or not, and which step took too long.

Unfortunately, there is an edge case where the step takes just longer than the timeout, where it is possible for the step to take slightly too long, but not actually fail due to the timeout. In this situation, we can't tell the difference.

The timeout step itself seems to know when it interrupted the step, so it could do this for us in a much more precise way.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Finde die Implementierung des Timeout-Schritts und seine Behandlung unterbrochener Schritte und prüfe anschließend alle vorhandenen timeout-bezogenen Tests. Ermittle, wie der Schritt festhält, dass er die Ausführung unterbrochen hat, und verwende dieses Signal für die spezifischere TimeoutException. Fertig ist die Aufgabe, wenn Timeout-Fehler den Timeout und den gerade ausgeführten Schritt identifizieren, ohne sich ausschließlich auf die verstrichene Dauer zu stützen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
devtools
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.