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

PtyProcess.spawn just got slower and can trigger problems #52

Open
cagney opened this issue Apr 4, 2019 · 2 comments
Open

PtyProcess.spawn just got slower and can trigger problems #52

cagney opened this issue Apr 4, 2019 · 2 comments

Comments

@cagney
Copy link

cagney commented Apr 4, 2019

This is somewhat related to #43.

Python 3.7.1 contains the change https://bugs.python.org/issue6721 that is trying to avoid a deadlock in the logging code. It works by having os.fork() grab all the logging locks before executing fork(). It's expensive - if the forked process is just going to exec then os.spawn() is preferred. Its also creating, lets say, interesting problems (deadlocks) with code that was working.

Since PtyProcess calls pty.fork() (which calls os.fork() ...) it triggering this code path.

Using some equivalent of os.spawn() would eliminate this.

@takluyver
Copy link
Member

I don't know how to combine the os.spawn* functions - or anything that doesn't involve a fork - with setting up a new pty as the controlling terminal of the child process. I suspect it's not possible, but it would be very nice if it was. If you figure it out, please let me know!

@cagney
Copy link
Author

cagney commented Apr 11, 2019

This is probably obsolete, #53 completely avoids fork().

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

No branches or pull requests

2 participants