Compare commits

...

2 Commits

Author SHA1 Message Date
Erik Johnston
11149c89c7 Newsfile 2020-09-28 14:33:56 +01:00
Erik Johnston
40c4cfbfb1 Correctly retry replication HTTP requests on timeout 2020-09-28 14:33:56 +01:00
3 changed files with 6 additions and 1 deletions

1
changelog.d/8412.bugfix Normal file
View File

@@ -0,0 +1 @@
Fix retries of HTTP requests between Synapse workers when the requests time out.

View File

@@ -35,6 +35,7 @@ from synapse.config import (
workers,
)
class ConfigError(Exception): ...
MISSING_REPORT_STATS_CONFIG_INSTRUCTIONS: str

View File

@@ -12,7 +12,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import abc
import logging
import re
@@ -26,6 +25,7 @@ from synapse.api.errors import (
RequestSendFailed,
SynapseError,
)
from synapse.http import RequestTimedOutError
from synapse.logging.opentracing import inject_active_span_byte_dict, trace
from synapse.util.caches.response_cache import ResponseCache
from synapse.util.stringutils import random_string
@@ -196,6 +196,9 @@ class ReplicationEndpoint(metaclass=abc.ABCMeta):
except CodeMessageException as e:
if e.code != 504 or not cls.RETRY_ON_TIMEOUT:
raise
except RequestTimedOutError:
if not cls.RETRY_ON_TIMEOUT:
raise
logger.warning("%s request timed out", cls.NAME)