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

Comments

Projects
None yet
3 participants
@prestontimmons

prestontimmons commented Feb 4, 2015

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

This comment has been minimized.

Show comment
Hide comment
@berkerpeksag

berkerpeksag Feb 6, 2015

Collaborator

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

Collaborator

berkerpeksag commented Feb 6, 2015

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

@berkerpeksag berkerpeksag added the bug :( label Feb 6, 2015

@tilgovi

This comment has been minimized.

Show comment
Hide comment
@tilgovi

tilgovi Feb 13, 2015

Collaborator

LGTM

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