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

Add signal handler for unclean shutdown #1

Open
jpmckinney opened this issue Nov 18, 2021 · 1 comment
Open

Add signal handler for unclean shutdown #1

jpmckinney opened this issue Nov 18, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@jpmckinney
Copy link
Member

jpmckinney commented Nov 18, 2021

Like in Scrapy https://github.com/scrapy/scrapy/blob/c316ca45a5b1b19622c96049c9378d8c45adba60/scrapy/crawler.py#L255

We'd need to set up a communication method between the threads and the main thread. You can't just call sys.exit() from the main thread, since Python handles this by calling wait_for_thread_shutdown().

For now, consumer callbacks should be designed to do a modest amount of work per message.

@jpmckinney jpmckinney added the enhancement New feature or request label Nov 18, 2021
@jpmckinney
Copy link
Member Author

jpmckinney commented Jul 3, 2023

With the new asynchronous client, this might just be about changing the default wait=True in self.executor.shutdown() to wait=False, if a second signal is sent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant