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 #9636

Closed
twisted-trac opened this issue May 6, 2019 · 3 comments

Comments

@twisted-trac
Copy link

morotti's avatar @morotti reported
Trac ID trac#9636
Type defect
Created 2019-05-06 20:49:32Z

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 (twisted.internet.process) 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.

Searchable metadata
trac-id__9636 9636
type__defect defect
reporter__morotti morotti
priority__normal normal
milestone__None None
branch__ 
branch_author__ 
status__closed closed
resolution__fixed fixed
component__core core
keywords__None None
time__1557175772812833 1557175772812833
changetime__1557287213057888 1557287213057888
version__None None
owner__hawkowl hawkowl

@twisted-trac
Copy link
Author

morotti's avatar @morotti commented

pull request: #1135

@twisted-trac
Copy link
Author

hawkowl's avatar @hawkowl set owner to @hawkowl

LGTM.

@twisted-trac
Copy link
Author

hawkowl's avatar @hawkowl set status to closed

In changeset 046a9b3

#!CommitTicketReference repository="" revision="046a9b3017d58b66b6f62239e734922f4edbc862"
Merge 9636-morotti-selectpatch: Remove hack to detect broken pipe behavior on linux < 2.6.11

Author: morotti
Reviewer: hawkowl
Fixes: ticket:9636

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants