Skip to content

fix(sdk): Deprecate StepConfig.semantics, add StepConfig.semanticsPerRetry with correct AT_MOST_ONCE behaviour#429

Merged
nvasiu merged 1 commit into
mainfrom
fix_at_most_once
Jun 5, 2026
Merged

fix(sdk): Deprecate StepConfig.semantics, add StepConfig.semanticsPerRetry with correct AT_MOST_ONCE behaviour#429
nvasiu merged 1 commit into
mainfrom
fix_at_most_once

Conversation

@nvasiu
Copy link
Copy Markdown
Contributor

@nvasiu nvasiu commented Jun 5, 2026

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Issue Link, if available

#394

Description

Steps configured with StepSemantics.AT_MOST_ONCE_PER_RETRY currently have incorrect behaviour. They are not retrying in the case of failures without a checkpoint.

This PR adds the correct AT_MOST_ONCE_PER_RETRY behaviour as part of a new enum (StepSemanticsPerRetry) in order to prevent a breaking change to users of the current StepSemantics.AT_MOST_ONCE_PER_RETRY.

  • Users can opt to use the new StepSemanticsPerRetry.AT_MOST_ONCE_PER_RETRY to get the correct AT_MOST_ONCE_PER_RETRY behaviour.
  • The existing StepSemantics with incorrect AT_MOST_ONCE_PER_RETRY behaviour is still available.
  • StepSemanticsPerRetry is null by default. So there will be no behaviour changes for users that haven't specified StepSemanticsPerRetry.
  • StepSemantics is being marked as deprecated, and will be fully removed in the next version update.

Code Changes

  • New StepSemanticsPerRetry.java.
  • StepSemantics.java has been marked as deprecated.
  • StepConfig.java
    • Added StepSemanticsPerRetry field/accessor/build.
    • Deprecated StepSemantics methods.
  • StepOperation.java
    • Updated to work with new StepSemanticsPerRetry.
    • Now retries on StepInterruptedException only when StepSemanticsPerRetry == AT_MOST_ONCE_PER_RETRY.
  • StepSemanticsIntegrationTest.java
    • Added tests for StepSemanticsPerRetry.
    • Updated the StepSemantics.AT_MOST_ONCE_PER_RETRY test to make clear that it is accepting incorrect behaviour, and this behaviour is being kept for backwards compatability.
  • StepConfigTest.java added tests for StepSemanticsPerRetry.

Demo/Screenshots

Checklist

  • I have filled out every section of the PR template
  • I have thoroughly tested this change

Testing

Unit Tests

Have unit tests been written for these changes? YES

Integration Tests

Have integration tests been written for these changes? YES

Examples

Has a new example been added for the change? (if applicable) N/A

@nvasiu nvasiu force-pushed the fix_at_most_once branch from 91cb6ba to 5d633a1 Compare June 5, 2026 19:00
zhongkechen
zhongkechen previously approved these changes Jun 5, 2026
Comment thread sdk/src/main/java/software/amazon/lambda/durable/operation/StepOperation.java Outdated
@zhongkechen zhongkechen marked this pull request as ready for review June 5, 2026 19:14
@zhongkechen zhongkechen requested a review from a team June 5, 2026 19:14
@zhongkechen zhongkechen dismissed their stale review June 5, 2026 19:14

One more thing to consider

Comment thread sdk/src/main/java/software/amazon/lambda/durable/config/StepConfig.java Outdated
@nvasiu nvasiu force-pushed the fix_at_most_once branch from 5d633a1 to ed2944b Compare June 5, 2026 21:19
@nvasiu nvasiu changed the title fix(sdk): Deprecate StepSemantics, add StepSemanticsPerRetry with correct AT_MOST_ONCE behaviour fix(sdk): Deprecate StepConfig.semantics, add StepConfig.semanticsPerRetry with correct AT_MOST_ONCE behaviour Jun 5, 2026
@nvasiu nvasiu merged commit baca327 into main Jun 5, 2026
11 checks passed
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.

2 participants