Skip to content

[Fix #1415] Try retryAttempt counter#1416

Open
fjtirado wants to merge 1 commit into
serverlessworkflow:mainfrom
fjtirado:Fix_#1415
Open

[Fix #1415] Try retryAttempt counter#1416
fjtirado wants to merge 1 commit into
serverlessworkflow:mainfrom
fjtirado:Fix_#1415

Conversation

@fjtirado
Copy link
Copy Markdown
Collaborator

@fjtirado fjtirado commented Jun 1, 2026

Fix #1415

Copilot AI review requested due to automatic review settings June 1, 2026 15:17
@fjtirado fjtirado requested a review from wmedvede June 1, 2026 15:18
@fjtirado fjtirado changed the title [Fix #1415] Try retryAttemp counter [Fix #1415] Try retryAttempt counter Jun 1, 2026
@fjtirado fjtirado marked this pull request as draft June 1, 2026 15:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 tryRetryCount field on TaskContext and updates DefaultRetryExecutor to 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.

Comment thread impl/test/src/test/java/io/serverlessworkflow/impl/test/RetryTimeoutTest.java Outdated
Comment thread impl/core/src/main/java/io/serverlessworkflow/impl/TaskContext.java
Comment thread impl/core/src/main/java/io/serverlessworkflow/impl/TaskContext.java
@fjtirado fjtirado force-pushed the Fix_#1415 branch 2 times, most recently from 87a7518 to c60d505 Compare June 1, 2026 16:13
@fjtirado fjtirado marked this pull request as ready for review June 1, 2026 16:14
Copilot AI review requested due to automatic review settings June 1, 2026 16:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Comment thread impl/core/src/main/java/io/serverlessworkflow/impl/TaskContext.java Outdated
Copilot AI review requested due to automatic review settings June 1, 2026 17:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread impl/core/src/main/java/io/serverlessworkflow/impl/TaskContext.java Outdated
Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Signed-off-by: fjtirado <[email protected]>
Copilot AI review requested due to automatic review settings June 1, 2026 17:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Try task retry attempt counter

2 participants