Merge pull request #382 from lbryio/silence_socket_error
silence "[Errno 11] Resource temporarily unavailable" error
This commit is contained in:
commit
11b1f8c7af
2 changed files with 13 additions and 1 deletions
|
@ -8,6 +8,8 @@ can and probably will change functionality and break backwards compatability
|
|||
at anytime.
|
||||
|
||||
## [Unreleased]
|
||||
### Fixed
|
||||
* Change EWOULDBLOCK error in DHT to warning. #481
|
||||
|
||||
## [0.8.3rc0] - 2017-02-10
|
||||
### Changed
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
import logging
|
||||
import binascii
|
||||
import time
|
||||
import socket
|
||||
import errno
|
||||
|
||||
from twisted.internet import protocol, defer
|
||||
from twisted.python import failure
|
||||
|
@ -251,7 +253,15 @@ class KademliaProtocol(protocol.DatagramProtocol):
|
|||
def _write_and_remove(self, key, txData, address):
|
||||
del self._call_later_list[key]
|
||||
if self.transport:
|
||||
self.transport.write(txData, address)
|
||||
try:
|
||||
self.transport.write(txData, address)
|
||||
except socket.error as err:
|
||||
if err.errno == errno.EWOULDBLOCK:
|
||||
# i'm scared this may swallow important errors, but i get a million of these
|
||||
# on Linux and it doesnt seem to affect anything -grin
|
||||
log.warning("Can't send data to dht: EWOULDBLOCK")
|
||||
else:
|
||||
raise err
|
||||
|
||||
def _sendResponse(self, contact, rpcID, response):
|
||||
""" Send a RPC response to the specified contact
|
||||
|
|
Loading…
Reference in a new issue