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

Fix trio with multiple workers #27

Merged
merged 1 commit into from Mar 3, 2020
Merged

Conversation

miracle2k
Copy link
Contributor

The shutdown_trigger argument of worker_serve needs to be a callable returning an awaitable, not an awaitable directly.

Without this, I get:

  File "/Users/michael/Library/Caches/pypoetry/virtualenvs/dbserver-k0bMYWkt-py3.7/lib/python3.7/site-packages/trio/_core/_run.py", line 730, in __aexit__
    raise combined_error_from_nursery
  File "/Users/michael/Library/Caches/pypoetry/virtualenvs/dbserver-k0bMYWkt-py3.7/lib/python3.7/site-packages/trio/_core/_run.py", line 730, in __aexit__
    raise combined_error_from_nursery
  File "/Users/michael/Library/Caches/pypoetry/virtualenvs/dbserver-k0bMYWkt-py3.7/lib/python3.7/site-packages/hypercorn/utils.py", line 156, in raise_shutdown
    await shutdown_event()
  File "/Users/michael/Library/Caches/pypoetry/virtualenvs/dbserver-k0bMYWkt-py3.7/lib/python3.7/site-packages/hypercorn/utils.py", line 156, in raise_shutdown
    await shutdown_event()

Whenever multiple workers are used.

The `shutdown_trigger` argument of `worker_serve` needs to be a callable returning an awaitable, not an awaitable directly.
@pgjones pgjones merged commit 4b614d8 into pgjones:master Mar 3, 2020
@pgjones
Copy link
Owner

pgjones commented Mar 3, 2020

Thanks @miracle2k - I'm going to try solve another bug (#24) before I release.

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.

None yet

2 participants