[issue25960] Popen.wait() hangs when called from a signal handler when os.waitpid() does not

2020-02-24 Thread Mike Frysinger
Mike Frysinger added the comment: if threading.active_count() returns 1, then you know there's one thread, and you're it, so it's not racey, and a lock ins't needed. thinking a bit more, what if the code just use a recursive lock ? that would restore the single threaded status quo without

[issue25960] Popen.wait() hangs when called from a signal handler when os.waitpid() does not

2020-02-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: Reopening so that spending time on deciding this in the future at least stays on my radar. Your workaround sounds like the reasonable, if understandably not pretty approach for now. -- resolution: wont fix -> remind status: closed -> open

[issue25960] Popen.wait() hangs when called from a signal handler when os.waitpid() does not

2020-02-24 Thread Gregory P. Smith
Change by Gregory P. Smith : -- keywords: +3.4regression, 3.5regression ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue25960] Popen.wait() hangs when called from a signal handler when os.waitpid() does not

2020-02-24 Thread Mike Frysinger
Mike Frysinger added the comment: to be clear, there is no Python or OS restriction that you're aware of for your earlier statement ? you just want to make it into a new Popen restriction that didn't previously exist ? we came across this bug as we upgraded our existing Python 2.7 codebase

[issue25960] Popen.wait() hangs when called from a signal handler when os.waitpid() does not

2020-02-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: yes, Popen's use of a lock since that change means that Popen.wait() cannot be called in an asynchronous context where its own execution could be blocking the execution of code that would unlock the lock. at this point we should probably just document

[issue25960] Popen.wait() hangs when called from a signal handler when os.waitpid() does not

2020-02-24 Thread Mike Frysinger
Mike Frysinger added the comment: > fundamentally: this shouldn't work anyways. > > You are calling wait() from a signal handler. > That is a blocking operation. > You cannot do that from a signal handler. what definition/spec are you referring to here ? is this a Python limitation ? i

[issue25960] Popen.wait() hangs when called from a signal handler when os.waitpid() does not

2015-12-27 Thread Chris Jerdonek
Changes by Chris Jerdonek : -- title: Popen.wait() hangs when called from a signal handler when os.waitpid(pid, os.WNOHANG) does not -> Popen.wait() hangs when called from a signal handler when os.waitpid() does not ___

[issue25960] Popen.wait() hangs when called from a signal handler when os.waitpid() does not

2015-12-27 Thread Gregory P. Smith
Gregory P. Smith added the comment: I think it still applies. os.waitpid even in blocking mode could hang at the whim of the OS. you aren't guaranteed that your child process has died and the OS is ready to return a status code. -- ___ Python