[Docs]: Document finally cleanup behavior during durable suspension
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 1/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 88/100
- Issue-Typ
- Dokumentation
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- java
- Bereich
- documentation
Rechercherichtung
Beginnen Sie in docs/advanced/error-handling.md mit dem Abschnitt „Handling SuspendExecutionException“ und sehen Sie sich die verlinkte gemeinsame Dokumentationsanfrage an, um den Kontext zu verstehen. Dokumentieren Sie, wie finally während einer Suspendierung funktioniert, erläutern Sie die sichere Platzierung der Bereinigung und die Weitergabe von Ausnahmen, und fügen Sie das vorgeschlagene Java-Beispiel ein; der Abschnitt ist fertig, wenn er sowohl die normale Suspendierung als auch die abschließenden Bereinigungspfade abdeckt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Issue
The Handling SuspendExecutionException section correctly explains that SuspendExecutionException extends Error, bypasses a normal catch (Exception e), and must never be swallowed.
It does not currently explain the related finally behavior: Java executes an active finally block while SuspendExecutionException unwinds the stack. As a result, resource cleanup placed in finally can run during a normal durable suspension rather than only when the overall durable execution succeeds or fails.
This applies to any operation that can suspend, including wait, waitForCondition, callbacks, invokes, retry delays, and suspension inside map or parallel branches.
For example, this pattern can terminate a resource immediately when the wait suspends:
try {
var resource = ctx.step("launch-resource", Resource.class,
stepCtx -> launchResource());
var result = ctx.waitForCallback("work-complete", Result.class,
(callbackId, stepCtx) -> dispatchWork(resource, callbackId));
return result;
} finally {
ctx.step("terminate-resource", Void.class,
stepCtx -> terminateResource());
}
Page/Location
https://github.com/aws/aws-durable-execution-sdk-java/blob/main/docs/advanced/error-handling.md
Section: Handling SuspendExecutionException
Suggested Fix
Extend the section with guidance that:
finallyexecutes when the internal suspension signal unwinds the handler stack.- Durable cleanup that must happen only on completion or actual failure should not be placed in
finallyaround suspending operations. - Cleanup should run explicitly after successful completion and from handlers for application or operation exceptions.
SuspendExecutionExceptionmust continue to propagate untouched; avoidcatch (Throwable)unless it immediately rethrows suspension and other control-flow errors appropriately.
Include a safe Java example such as:
try {
var result = performDurableWorkThatMaySuspend(ctx);
ctx.step("cleanup-resource", Void.class,
stepCtx -> cleanupResource());
return result;
} catch (Exception e) {
ctx.step("cleanup-resource", Void.class,
stepCtx -> cleanupResource());
throw e;
}
The cleanup step occupies the same next durable-operation position on either terminal path, while SuspendExecutionException bypasses catch (Exception e) and suspends normally.
This is the Java-specific companion to the shared documentation request: https://github.com/aws/aws-durable-execution-docs/issues/131.
- Vorherrschende Sprache
- Java
- Sterne
- 28
- Forks
- 18
- Ø Merge
- 18 Std. 16 Min.
- Gemergte PRs (30 T.)
- 62
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus aws/aws-durable-execution-sdk-java
-
bug pkg:conformance
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
aws/aws-durable-execution-sdk-java#844 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
aws/aws-durable-execution-sdk-java#300 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug pkg:telemetry
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 54/100
aws/aws-durable-execution-sdk-java#877 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug needs-triage pkg:sdk
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
aws/aws-durable-execution-sdk-java#859 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug needs-triage pkg:otel
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
aws/aws-durable-execution-sdk-java#858 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in aws/aws-durable-execution-sdk-java
Ähnliche Issues
-
account bug exercise lecture programming user interface
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
ls1intum/Artemis#14512 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
swiftlang/swift-java#955 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Good First Issue
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
hiero-ledger/hiero-sdk-java#3044 ·
Maintainer antworten meist innerhalb von 1 Tag
-
A second build without clean fails in resources-optimizer-maven-plugin because minified files are minified againEvtl. vergeben @papegaaij hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
hermes-queue
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
chrisalunlloyd2-sudo/mindpalace#337 ·
Maintainer antworten meist innerhalb von 1 Tag