diff --git a/lbrynet/core/client/BlobRequester.py b/lbrynet/core/client/BlobRequester.py index c90d70d9e..86dd1768f 100644 --- a/lbrynet/core/client/BlobRequester.py +++ b/lbrynet/core/client/BlobRequester.py @@ -5,6 +5,7 @@ from twisted.python.failure import Failure from zope.interface import implements from lbrynet.core.Error import PriceDisagreementError, DownloadCanceledError, InsufficientFundsError from lbrynet.core.Error import InvalidResponseError, RequestCanceledError, NoResponseError +from lbrynet.core.Error import ConnectionClosedBeforeResponseError from lbrynet.core.client.ClientRequest import ClientRequest, ClientBlobRequest from lbrynet.interfaces import IRequestCreator @@ -304,4 +305,8 @@ class BlobRequester(object): peer.update_score(-10.0) else: peer.update_score(-2.0) + if reason.check(ConnectionClosedBeforeResponseError): + return + # Only unexpected errors should be returned, as they are indicative of real problems + # and may be shown to the user. return reason \ No newline at end of file diff --git a/lbrynet/lbrylive/client/LiveStreamMetadataHandler.py b/lbrynet/lbrylive/client/LiveStreamMetadataHandler.py index 2167bd719..f24d4ab46 100644 --- a/lbrynet/lbrylive/client/LiveStreamMetadataHandler.py +++ b/lbrynet/lbrylive/client/LiveStreamMetadataHandler.py @@ -9,7 +9,7 @@ from lbrynet.lbrylive.LiveBlob import LiveBlobInfo from lbrynet.core.cryptoutils import get_lbry_hash_obj, verify_signature from lbrynet.interfaces import IRequestCreator, IMetadataHandler from lbrynet.core.Error import InsufficientFundsError, InvalidResponseError, RequestCanceledError -from lbrynet.core.Error import NoResponseError +from lbrynet.core.Error import NoResponseError, ConnectionClosedBeforeResponseError class LiveStreamMetadataHandler(object): @@ -339,4 +339,8 @@ class LiveStreamMetadataHandler(object): logging.warning("Crypt stream info finder: a request failed. Reason: %s", reason.getErrorMessage()) self._update_local_score(peer, -5.0) peer.update_score(-10.0) + if reason.check(ConnectionClosedBeforeResponseError): + return + # Only unexpected errors should be returned, as they are indicative of real problems + # and may be shown to the user. return reason \ No newline at end of file diff --git a/lbrynet/lbrynet_console/plugins/BlindRepeater/BlindMetadataHandler.py b/lbrynet/lbrynet_console/plugins/BlindRepeater/BlindMetadataHandler.py index 5697981b0..2519e617d 100644 --- a/lbrynet/lbrynet_console/plugins/BlindRepeater/BlindMetadataHandler.py +++ b/lbrynet/lbrynet_console/plugins/BlindRepeater/BlindMetadataHandler.py @@ -2,7 +2,7 @@ from zope.interface import implements from lbrynet.interfaces import IMetadataHandler, IRequestCreator from lbrynet.core.client.ClientRequest import ClientRequest, ClientPaidRequest from lbrynet.core.Error import InsufficientFundsError, InvalidResponseError, RequestCanceledError -from lbrynet.core.Error import NoResponseError +from lbrynet.core.Error import NoResponseError, ConnectionClosedBeforeResponseError from ValuableBlobInfo import ValuableBlobInfo import datetime import logging @@ -292,6 +292,10 @@ class BlindMetadataHandler(object): str(request_type), str(reason.getErrorMessage())) self._update_local_score(peer, -10.0) peer.update_score(-5.0) + if reason.check(ConnectionClosedBeforeResponseError): + return + # Only unexpected errors should be returned, as they are indicative of real problems + # and may be shown to the user. return reason def _search_for_peers(self):