Merge branch 'hawkowl/more-aggressive-no-retry' into hawkowl/federation-limiter
This commit is contained in:
commit
d7ac3a57ae
|
@ -182,7 +182,7 @@ class TransportLayerClient(object):
|
|||
long_retries=True,
|
||||
backoff_on_404=True, # If we get a 404 the other side has gone
|
||||
try_trailing_slash_on_400=True,
|
||||
retry_on_dns_fail=self.backoff_settings.dns_resolution,
|
||||
retry_on_dns_fail=not self.backoff_settings.dns_resolution,
|
||||
)
|
||||
|
||||
defer.returnValue(response)
|
||||
|
|
|
@ -22,6 +22,7 @@ from io import BytesIO
|
|||
from OpenSSL import SSL
|
||||
|
||||
from six import PY3, raise_from, string_types
|
||||
from service_identity.exceptions import VerificationError
|
||||
from six.moves import urllib
|
||||
|
||||
import attr
|
||||
|
@ -38,6 +39,7 @@ from twisted.internet.error import (
|
|||
ConnectionRefusedError,
|
||||
DNSLookupError,
|
||||
TimeoutError,
|
||||
ConnectingCancelledError,
|
||||
)
|
||||
from twisted.internet.interfaces import IReactorPluggableNameResolver
|
||||
from twisted.internet.task import _EPSILON, Cooperator
|
||||
|
@ -433,7 +435,7 @@ class MatrixFederationHttpClient(object):
|
|||
for i in e.reasons:
|
||||
# If it's an OpenSSL error, they probably don't have
|
||||
# a valid certificate or something else very bad went on.
|
||||
if i.check(SSL.Error):
|
||||
if i.check(SSL.Error) or i.check(VerificationError):
|
||||
if self.backoff_settings.invalid_tls:
|
||||
raise_from(RequestSendFailed(e, can_retry=False), e)
|
||||
|
||||
|
@ -446,7 +448,7 @@ class MatrixFederationHttpClient(object):
|
|||
logger.info("Failed to send request: %s", e)
|
||||
raise_from(RequestSendFailed(e, can_retry=True), e)
|
||||
|
||||
except TimeoutError as e:
|
||||
except (TimeoutError, ConnectingCancelledError) as e:
|
||||
# Handle timeouts
|
||||
if self.backoff_settings.on_timeout:
|
||||
raise_from(RequestSendFailed(e, can_retry=False), e)
|
||||
|
|
Loading…
Reference in a new issue