Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit f4caed8

Browse files
author
Sean Quah
committed
Fix RetryDestinationLimiter re-starting finished log contexts
Signed-off-by: Sean Quah <[email protected]>
1 parent 96df312 commit f4caed8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

changelog.d/12795.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a long-standing bug where finished log contexts would be re-started when failing to contact remote homeservers.

synapse/util/retryutils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
from types import TracebackType
1717
from typing import TYPE_CHECKING, Any, Optional, Type
1818

19-
import synapse.logging.context
2019
from synapse.api.errors import CodeMessageException
20+
from synapse.metrics.background_process_metrics import run_as_background_process
2121
from synapse.storage import DataStore
2222
from synapse.util import Clock
2323

@@ -265,4 +265,6 @@ async def store_retry_timings() -> None:
265265
logger.exception("Failed to store destination_retry_timings")
266266

267267
# we deliberately do this in the background.
268-
synapse.logging.context.run_in_background(store_retry_timings)
268+
run_as_background_process(
269+
f"store_retry_timings-{self.destination}", store_retry_timings
270+
)

0 commit comments

Comments
 (0)