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

OSError: Bad file descriptor raised when using Python 3.4 and USR2 signal #978

Closed
prestontimmons opened this issue Feb 4, 2015 · 2 comments
Labels

Comments

@prestontimmons
Copy link

After upgrading a Python 2 application to Python 3.4, I noticed an OSError is raised when sending a USR2 signal to the process. I believe the problem is related to a change in socket behavior in Python 3.4:

https://docs.python.org/3.4/library/os.html#fd-inheritance

I don't know if this is a correct fix, but adding the below lines to Arbiter.start made the OSError go away:

for sock in self.LISTENERS:
    sock.set_inheritable(True)

This is using version 19.2.1.

@berkerpeksag
Copy link
Collaborator

The fix LGTM. We probably will need to add a helper function in gunicorn/_compat.py.

@berkerpeksag berkerpeksag added this to the R19.3 milestone Feb 6, 2015
@tilgovi
Copy link
Collaborator

tilgovi commented Feb 13, 2015

LGTM

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

No branches or pull requests

3 participants