Skip to content

Add a custom gunicorn sync worker implementation which works around some issues #2571

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 3 commits into from
Apr 4, 2016

Conversation

Kami
Copy link
Member

@Kami Kami commented Mar 9, 2016

This includes a custom sync worker implementation which includes a work-around for shutdown related issues when using sync worker in combination with eventlet monkey patching,.

…ome issues

which occur when eventlet monkey patching is used with sync worker.
@manasdk
Copy link
Contributor

manasdk commented Mar 9, 2016

@Kami - where did you find out that this was the workaround. Did you read gunicorn code to decide which method to overwrite?

@Kami
Copy link
Member Author

Kami commented Mar 9, 2016

@manasdk Yep, I checked the sync and base worker implementation.

Without that it fails with the error below inside handle_quit (https://github.com/benoitc/gunicorn/blob/master/gunicorn/workers/base.py#L170).

    assert hub.greenlet is not current, 'do not call blocking functions from the mainloop'
AssertionError: do not call blocking functions from the mainloop

I'm not too big of a fan of this work-around, but dunno. There are also other issues with async (eventlet) based worker.

@manasdk
Copy link
Contributor

manasdk commented Mar 17, 2016

@Kami If you want to still merge this change please include reference to code from gunicorn in the new file so it is easy for someone to track this down in the future.

@Kami
Copy link
Member Author

Kami commented Mar 17, 2016

@manasdk Does af54ffb make it any more clear?

@Kami Kami merged commit ee6330d into master Apr 4, 2016
@Kami Kami deleted the gunicorn_sync_worker_workaround branch April 4, 2016 10:36
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.

2 participants