[issue32275] SSL socket methods don't retry on EINTR?

2021-06-11 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
nosy: +erlendaasland

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32275] SSL socket methods don't retry on EINTR?

2019-05-07 Thread Julien Palard


Change by Julien Palard :


--
nosy:  -mdk

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32275] SSL socket methods don't retry on EINTR?

2017-12-11 Thread Julien Palard

Julien Palard  added the comment:

Looks like this behavior is documented in the bio_should_retry(3) man page.

Basically bio_should_retry() tells if the error was non-fatal:

int BIO_fd_should_retry(int i)
{
int err;

if ((i == 0) || (i == -1)) {
err = get_last_sys_error();

return BIO_fd_non_fatal_error(err);
}
return 0;
}

--
nosy: +mdk

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32275] SSL socket methods don't retry on EINTR?

2017-12-11 Thread Christian Heimes

Change by Christian Heimes :


--
assignee: christian.heimes -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32275] SSL socket methods don't retry on EINTR?

2017-12-11 Thread Christian Heimes

Change by Christian Heimes :


--
assignee:  -> christian.heimes
components: +SSL
stage:  -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32275] SSL socket methods don't retry on EINTR?

2017-12-11 Thread STINNER Victor

STINNER Victor  added the comment:

See bpo-23618 for handling EINTR in socket and bpo-23834 for sock_call().

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32275] SSL socket methods don't retry on EINTR?

2017-12-11 Thread STINNER Victor

STINNER Victor  added the comment:

"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().

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32275] SSL socket methods don't retry on EINTR?

2017-12-11 Thread Antoine Pitrou

New submission from Antoine Pitrou :

Some time ago, PEP 475 was accepted in order to automatically retry system 
calls on EINTR, but the _ssl module wasn't touched.

However, it seems that OpenSSL socket calls can fail with EINTR:
https://stackoverflow.com/questions/24188013/openssl-and-signals

--
messages: 308026
nosy: alex, christian.heimes, dstufft, janssen, njs, pitrou, vstinner
priority: normal
severity: normal
status: open
title: SSL socket methods don't retry on EINTR?
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com