-
Notifications
You must be signed in to change notification settings - Fork 189
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
Fix FnStream generator polling to prevent poll-after-ready #1903
Conversation
A new generated diff is ready to view.
A new doc preview is ready to view. |
// smithy-rs#1902: there was a bug where we could continue to poll the generator after it | ||
// had returned Poll::Ready. This test case leaks the tx half so that the channel stays open | ||
// but the send side generator completes. By calling `poll` multiple times on the resulting future, | ||
// we can trigger the bug and validate the fix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the explanatory comment!
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
Motivation and Context
#1902 :
FnStream
had a bug where, under load, an async function was polled after already being doneDescription
This change wraps the generator in an option, nulling it after completion to prevent double-polling
Testing
Unit tests + all of the current paginator integration tests
Checklist
CHANGELOG.next.toml
if I made changes to the smithy-rs codegen or runtime cratesCHANGELOG.next.toml
if I made changes to the AWS SDK, generated SDK code, or SDK runtime cratesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.