[Fix #1415] Try retryAttempt counter#1416
Open
fjtirado wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #1415 by changing how retry attempt counts are tracked for try/catch retries so that retry attempts are attributed to the task(s) executed within a try, rather than making it look like the TryTask itself is being retried.
Changes:
- Introduces a separate
tryRetryCountfield onTaskContextand updatesDefaultRetryExecutorto use it for try-based retries. - Adds/updates tests (including a new nested try/catch/retry workflow sample) to validate retry attempt counting behavior, including nested scenarios.
- Updates persistence restore logic/tests to restore retry-related state.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| impl/test/src/test/resources/workflows-samples/nested-try-catch-retry-inline.yaml | Adds a nested try/catch/retry sample workflow used by tests. |
| impl/test/src/test/java/io/serverlessworkflow/impl/test/RetryTimeoutTest.java | Expands retry tests to assert correct retry attempt attribution, including nested retries. |
| impl/persistence/tests/src/main/java/io/serverlessworkflow/impl/persistence/test/AbstractHandlerPersistenceTest.java | Updates persistence test expectations for restored retry state. |
| impl/persistence/api/src/main/java/io/serverlessworkflow/impl/persistence/WorkflowPersistenceInstance.java | Adjusts retry state restoration in persistence layer. |
| impl/core/src/main/java/io/serverlessworkflow/impl/TaskContext.java | Adds tryRetryCount and changes how retry attempts are derived across parent/child task contexts. |
| impl/core/src/main/java/io/serverlessworkflow/impl/executors/retry/DefaultRetryExecutor.java | Switches try-based retry counting to tryRetryCount instead of retryAttempt. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
87a7518 to
c60d505
Compare
Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: fjtirado <ftirados@ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #1415