Skip to content

[bugfix]: fix polling#302

Merged
zhongkechen merged 2 commits intomainfrom
polling
Mar 31, 2026
Merged

[bugfix]: fix polling#302
zhongkechen merged 2 commits intomainfrom
polling

Conversation

@zhongkechen
Copy link
Copy Markdown
Contributor

@zhongkechen zhongkechen commented Mar 31, 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

Fixes #295

Description

The step operation throws a NullPointerException when it fails and polls for the next attempt.

The exception is thrown because the nextAttemptTimestamp parameter is null setting up the polling.

The exception was swallowed, leaving the polling unset.

Fix:

  • catch the unhandled exception thrown from operations (including step operation in this case) and terminate the execution. This will help us detect this issue as well as similar issues in future
  • fix the null pointer exception in Step operation when handling a failed step attempt

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?

Integration Tests

Have integration tests been written for these changes?

Examples

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

@zhongkechen zhongkechen self-assigned this Mar 31, 2026
@zhongkechen zhongkechen marked this pull request as ready for review March 31, 2026 23:29
@zhongkechen zhongkechen requested a review from a team March 31, 2026 23:29
@zhongkechen zhongkechen added this to the 1.1 - Apr 30 2026 milestone Mar 31, 2026

// Poll for READY status and then execute the step again
pollReadyAndExecuteStepLogic(getOperation(), attempt + 1);
pollReadyAndExecuteStepLogic(Instant.now().plusSeconds(retryDelayInSeconds), attempt + 1);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For Retry OperationAction, the backend doesn't immediately return an operation with the nextAttemptTimestamp, which is while we get null pointer for it here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we have any tests that needs to be updated?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Existing tests are able to cover this with the change in handling user function exceptions.

@zhongkechen zhongkechen merged commit f3aa4ed into main Mar 31, 2026
11 checks passed
@zhongkechen zhongkechen deleted the polling branch March 31, 2026 23:47
@wangyb-A wangyb-A mentioned this pull request Apr 1, 2026
2 tasks
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.

[Bug]: Unexpected suspend when a step failed for retry

3 participants