Ingore SSL_ERROR_WANT_READ/WRITE errors
Before this change, the connection would be defuncted when the error occurred. Instead, these can safely be ignored and the recv() call retried.
This commit is contained in:
@@ -12,6 +12,9 @@ Bug Fixes
|
||||
* Correctly supply compaction and compression parameters in CREATE statements
|
||||
for tables when working with Cassandra 2.0+
|
||||
* Lowercase boolean literals when generating schemas
|
||||
* Ignore SSL_ERROR_WANT_READ and SSL_ERROR_WANT_WRITE socket errors. Previously,
|
||||
these resulted in the connection being defuncted, but they can safely be
|
||||
ignored by the driver.
|
||||
|
||||
Other
|
||||
-----
|
||||
|
||||
@@ -258,7 +258,11 @@ class AsyncoreConnection(Connection, asyncore.dispatcher):
|
||||
if len(buf) < self.in_buffer_size:
|
||||
break
|
||||
except socket.error as err:
|
||||
if err.args[0] not in NONBLOCKING:
|
||||
if ssl and isinstance(err, ssl.SSLError):
|
||||
if err.args[0] not in (ssl.SSL_ERROR_WANT_READ, ssl.SSL_ERROR_WANT_WRITE):
|
||||
self.defunct(err)
|
||||
return
|
||||
elif err.args[0] not in NONBLOCKING:
|
||||
self.defunct(err)
|
||||
return
|
||||
|
||||
|
||||
@@ -311,7 +311,11 @@ class LibevConnection(Connection):
|
||||
if len(buf) < self.in_buffer_size:
|
||||
break
|
||||
except socket.error as err:
|
||||
if err.args[0] not in NONBLOCKING:
|
||||
if ssl and isinstance(err, ssl.SSLError):
|
||||
if err.args[0] not in (ssl.SSL_ERROR_WANT_READ, ssl.SSL_ERROR_WANT_WRITE):
|
||||
self.defunct(err)
|
||||
return
|
||||
elif err.args[0] not in NONBLOCKING:
|
||||
self.defunct(err)
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user