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 process crash. Remove hack to detect broken pipe behavior on linux < 2.6.11 #1135

Merged
merged 5 commits into from May 8, 2019

Conversation

morotti
Copy link
Contributor

@morotti morotti commented May 6, 2019

kernel 2.6.11 was deprecated a long time ago. For reference, there were the last OS using it:

  • Debian 3 - 2005-2008
  • RHEL 4 - 2005-2011

detectLinuxBrokenPipeBehavior() instantiates a pipe during import and calls select() to detect whether it is writeable.

This hack was meant to detect broken pipe behavior on linux < 2.6.11. select() is itself broken (including on recent kernels), crashing the python interpreter when there are more than 1024 opened file descriptors for the process.

This effectively causes applications attempting to (lazily) import twisted to crash -if 1024 file/socket are opened-.

Given the comments, it was known that this workaround was broken at the time it was made. Had to pick the lesser evil between the two kernel issues, broken pipe or broken select(). This should be removed since pipes were fixed, but select was not.

Remove this paragraph

Please have a look at our developer documentation before submitting your Pull Request.

https://twistedmatrix.com/trac/wiki/TwistedDevelopment#SubmittingaPatch

Contributor Checklist:

morotti and others added 5 commits May 6, 2019 21:41
…x kernel < 2.6.11.

kernel 2.6.11 was deprecated a long time ago. For reference, there were the last OS using it:
- Debian 3 - 2005-2008
- RHEL 4 - 2005-2011

The hack instantiates a pipe during import and calls select() to detect whether it is writeable. This was meant to detect broken pipe behavior on linux < 2.6.11.  select() is itself broken (including on recent kernels), crashing the python interpreter when there are more than 1024 opened file descriptors for the process.

This effectively causes applications attempting to (lazily) import twisted to crash -if 1024 file/socket are opened-.

Given the comments, it was known that this workaround was broken at the time it was made. Had to pick the lesser evil between the two kernel issues, broken pipe or broken select(). This should be removed since pipes were fixed, but select was not.
@hawkowl
Copy link
Member

hawkowl commented May 8, 2019

The lint failure is spurious, so I'm going to merge this.

@hawkowl hawkowl merged commit 046a9b3 into twisted:trunk May 8, 2019
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