-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[wip] reactor handlesignals #6030
Conversation
…nly if `twisted_version` below 23.8.0
Codecov Report
@@ Coverage Diff @@
## master #6030 +/- ##
==========================================
- Coverage 88.92% 88.92% -0.01%
==========================================
Files 162 162
Lines 11445 11443 -2
Branches 1861 1861
==========================================
- Hits 10178 10176 -2
Misses 962 962
Partials 305 305
|
I think Twisted sets handlers for INT and BREAK conditionally but for TERM unconditionally, so I would expect our TERM handler to be overridden in at least some cases if this line is removed. |
After thinking about it for some more I think it makes sense that calling or not calling this doesn't make a difference, whatever the call order. But can you please check if with old Twisted a simple |
In Lines 389 to 397 in a320e5f
While if we will run scrapy with |
Oh! Then yeah, it probably doesn't make sense. OTOH |
After discussing this with @kmike we want this:
|
I don’t think we do. It may be useful for #4749 as well. |
For (2):
The last point is an important difference, I don't want to break this. So we want to either call the SIGCHLD-related Twisted code directly in For the first option it's again calling some private code which I don't want to do. For the second option it means Twisted will overwrite our SIGTERM and SIGBREAK handlers but leave our SIGINT handler. We can try finding a later point at which to install our handlers. |
https://stackoverflow.com/questions/74929947/twisted-application-ignoring-a-certain-unix-signal-is-it-possible suggests |
Fix to #6024
From my observations of scrapy code and related twisted pull request I conclude that call of
reactor._handleSignals()
or it's equivalent from new twisted version - are not needed insideinstall_shutdown_handlers
to run scrapy.At least on my local environment with both new/old twisted versions I didn't noticed anything unexpected.