STINNER Victor added the comment:
It seems like the root issue was fixed by myself in the bpo-30320. Sorry
Martin, I forgot this issue and so forgot to review your patch.
But it seems like we took a similar approach: using signal.pthread_sigmask()
seems to be the only right way to write a
Martin Panter added the comment:
My patch doesn’t help answer the question of why this only fails on BSD, so I
will hold off on committing it. However v2 has a minor update to skip the test
when pthread_sigmask() is unavailable.
--
versions: +Python 3.7
Added file:
Martin Panter added the comment:
Happened again:
http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.x/builds/4990/steps/test/logs/stdio
Timeout (0:10:00)!
Thread 0x000801807400 (most recent call first):
File
Roundup Robot added the comment:
New changeset ddce15b21c21 by Victor Stinner in branch '3.5':
Backport fixes on test_eintr
https://hg.python.org/cpython/rev/ddce15b21c21
--
___
Python tracker
STINNER Victor added the comment:
> This would also be avoided by blocking SIGUSR1.
Sorry, I'm lost on this old and complex issue. Can you please propose a patch?
If it doesn't break test_eintr on Linux and FreeBSD, we can just push
it and take a look sometimes at FreeBSD buildbots ;-)
Martin Panter added the comment:
(Wrote this ages ago but never hit send:)
Here is another theory to explain the hang: When sigwaitinfo() is being called,
and the SIGALRM signal arrives, it executes the signal handler (both the C
handler and later the Python handler). If the SIGUSR1 signal
STINNER Victor added the comment:
> With the pipe, there is still a potential race after the parent writes to the
> pipe and before sigwaitinfo() is invoked, versus the child sleep() call.
Yeah, I know, that's why I kept the ugly 100 ms sleep.
> What do you think of my suggestion to block the
Roundup Robot added the comment:
New changeset 7f49af7046e4 by Victor Stinner in branch 'default':
Issue #25868: Try to make test_eintr.test_sigwaitinfo() more reliable
https://hg.python.org/cpython/rev/7f49af7046e4
--
nosy: +python-dev
___
Python
New submission from STINNER Victor:
Re-running test 'test_eintr' in verbose mode
test_all (test.test_eintr.EINTRTests) ... test test_eintr failed
FAIL
==
FAIL: test_all (test.test_eintr.EINTRTests)
Martin Panter added the comment:
With the pipe, there is still a potential race after the parent writes to the
pipe and before sigwaitinfo() is invoked, versus the child sleep() call.
What do you think of my suggestion to block the signal? Then (in theory) it
should be robust, rather than
Martin Panter added the comment:
You would only block SIGUSR1 (the signal being waited for). SIGALRM would
remain unblocked, so the syscall should be interrupted by it.
If everything is working smoothly, you should generally see two SIGALRM
interrupts per sleep time, so I don’t think it is
STINNER Victor added the comment:
I used a short sleep of 100 ms to test if the pipe is enough to synchronize the
parent and the child, but this delay is too short to test that sigwaitinfo() is
interrupted by EINTR.
"self.sleep_time = 0.100" must be removed to use the default sleep time
Martin Panter added the comment:
BTW I definitely think your pipe solution is better than before, which was
relying on the whole Python process startup time being fast. The race window
should be much smaller now.
--
___
Python tracker
13 matches
Mail list logo