diff --git a/synapse/logging/_remote.py b/synapse/logging/_remote.py
index 5a61b21eaf..3a07df867c 100644
--- a/synapse/logging/_remote.py
+++ b/synapse/logging/_remote.py
@@ -193,7 +193,7 @@ class RemoteHandler(logging.Handler):
self._connection_waiter = None
deferred: Deferred = self._service.whenConnected(failAfterFailures=1)
- deferred.addCallbacks(writer, fail)
+ deferred.addCallbacks(writer, fail) # type: ignore[unused-awaitable]
self._connection_waiter = deferred
def _handle_pressure(self) -> None:
diff --git a/synapse/logging/context.py b/synapse/logging/context.py
index f62bea968f..56972f42a6 100644
--- a/synapse/logging/context.py
+++ b/synapse/logging/context.py
@@ -843,7 +843,7 @@ def run_in_background( # type: ignore[misc]
# which is supposed to have a single entry and exit point. But
# by spawning off another deferred, we are effectively
# adding a new exit point.)
- res.addBoth(_set_context_cb, ctx)
+ res.addBoth(_set_context_cb, ctx) # type: ignore[unused-awaitable]
return res
@@ -870,7 +870,7 @@ def make_deferred_yieldable(deferred: "defer.Deferred[T]") -> "defer.Deferred[T]
# ok, we can't be sure that a yield won't block, so let's reset the
# logcontext, and add a callback to the deferred to restore it.
prev_context = set_current_context(SENTINEL_CONTEXT)
- deferred.addBoth(_set_context_cb, prev_context)
+ deferred.addBoth(_set_context_cb, prev_context) # type: ignore[unused-awaitable]
return deferred
diff --git a/synapse/logging/opentracing.py b/synapse/logging/opentracing.py
index b69060854f..180061c99e 100644
--- a/synapse/logging/opentracing.py
+++ b/synapse/logging/opentracing.py
@@ -908,7 +908,7 @@ def _custom_sync_async_decorator(
scope.__exit__(None, None, None)
return result
- result.addCallbacks(call_back, err_back)
+ result.addCallbacks(call_back, err_back) # type: ignore[unused-awaitable]
else:
if inspect.isawaitable(result):
|