Skip to content
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

Call handler.poll_ready() before handler.call() #437

Merged
merged 1 commit into from
Mar 3, 2022
Merged

Call handler.poll_ready() before handler.call() #437

merged 1 commit into from
Mar 3, 2022

Conversation

lazear
Copy link
Contributor

@lazear lazear commented Mar 2, 2022

I discovered this issue while trying to build a Service router, using the tower::steer module, which panics if poll_ready has not been called. I was able to work around this issue by implementing the functionality myself, but after digging into the tower Service docs, this appears to be mandated by the API:

According to the tower::Service documentation and API contract, poll_ready must be called and a Poll:Ready must be obtained before invoking call.

Issue #, if available:

Description of changes:
I wrapped the body of the handler invoking function in a call to poll_ready.
See documentation for tower::Service::call

By submitting this pull request

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I confirm that I've made a best effort attempt to update all relevant documentation. (N/A?)

According to the tower::Service documentation and API contract,
`poll_ready` must be called and a `Poll:Ready` must be obtained before
invoking `call`
@calavera calavera requested a review from nmoutschen March 3, 2022 03:51
Copy link
Contributor

@calavera calavera left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@nmoutschen nmoutschen left a comment

Choose a reason for hiding this comment

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

LGTM! This passes the existing integration tests.

@nmoutschen nmoutschen merged commit e43bc28 into awslabs:main Mar 3, 2022
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.

3 participants