Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: periodic polling sample #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2025
Merged

Conversation

Nomango
Copy link
Contributor

@Nomango Nomango commented Apr 30, 2025

What was changed

Fixed the retry loop in the "Periodic Polling of a Sequence of Activities" example.

Reference taken from the samples-java implementation.

Why?

Previously, continue_as_new was inside the retry loop, causing the workflow to restart after just one failed attempt, instead of retrying up to 10 times as intended.

Checklist

  1. Closes [Bug] continue_as_new prematurely exits retry loop in "Periodic Polling of a Sequence of Activities" example #182

  2. How was this tested:
    Manually tested by running the workflow and verifying that it retries 10 times before continuing as new. Also validated expected logging behavior.

  3. Any docs updates needed?
    No updates needed.

@Nomango Nomango requested a review from a team as a code owner April 30, 2025 03:21
@CLAassistant
Copy link

CLAassistant commented Apr 30, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

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

Thanks! Minor suggestion, then happy to merge

Comment on lines 43 to 44
# unreachable
return ""
Copy link
Member

@cretz cretz Apr 30, 2025

Choose a reason for hiding this comment

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

Suggested change
# unreachable
return ""

continue_as_new return type hint has https://docs.python.org/3/library/typing.html#typing.NoReturn, so shouldn't need this part (but didn't test, maybe mypy needs it)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've made the changes. Let's have the CI workflows check it.

@Nomango Nomango force-pushed the fix/periodic_polling branch from 10fdec6 to 88b3a88 Compare May 5, 2025 05:32
Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

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

Thanks!

@cretz cretz merged commit 872144d into temporalio:main May 5, 2025
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.

[Bug] continue_as_new prematurely exits retry loop in "Periodic Polling of a Sequence of Activities" example
3 participants