Message308028
"it seems that OpenSSL socket calls can fail with EINTR: ..."
You are easily test by raising a signal: see Lib/test/test_eintr.py which stress Python functions by sending a signal every 100 ms while Python is blocked in a syscall.
If there is a bug, sure, it must be fixed ;-)
It was very tricky to handle EINTR properly in the socket module. While most Python functions are thin wrapper to syscalls with no timeout, almost every socket functions have a timeout. So I wrote sock_call() to factorize the code. This function calls select() internally to check if the socket is "ready", but also updates the timeout, etc.
A few other Python are retried on EINTR and update a timeout, like select.select(), time.sleep(), threading.Lock.acquire() and signal.sigtimedwait(). |
|
| Date |
User |
Action |
Args |
| 2017-12-11 11:12:26 | vstinner | set | recipients:
+ vstinner, janssen, pitrou, christian.heimes, alex, njs, dstufft |
| 2017-12-11 11:12:26 | vstinner | set | messageid: <1512990746.17.0.213398074469.issue32275@psf.upfronthosting.co.za> |
| 2017-12-11 11:12:26 | vstinner | link | issue32275 messages |
| 2017-12-11 11:12:26 | vstinner | create | |
|