aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar JustAnotherArchivist2022-07-11 00:09:14 +0000
committerGravatar JustAnotherArchivist2022-07-11 00:09:14 +0000
commit577e10c80b3bd4543b3ecc52b275a7c9976c393f (patch)
treed93b0ecf2bc6c03183c66e6fff8c11e95cb9b2aa
parentWork around Grafana's new alerting system not actually sending alerts (change... (diff)
Fix disconnects when there is a large send queue
The message delivery confirmation didn't send the PING immediately, so the remaining send queue blocked it, which would then cause the confirmation to fail, all messages to be requeued, and the connection to be closed.
-rw-r--r--http2irc.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/http2irc.py b/http2irc.py
index 4498a4c..f2db4e3 100644
--- a/http2irc.py
+++ b/http2irc.py
@@ -586,7 +586,7 @@ class IRCClientProtocol(asyncio.Protocol):
continue
self.logger.debug('Trying to confirm message delivery')
self.pongReceivedEvent.clear()
- self.send(b'PING :42')
+ self._direct_send(b'PING :42')
await wait_cancel_pending({asyncio.create_task(self.pongReceivedEvent.wait())}, return_when = asyncio.FIRST_COMPLETED, timeout = 5)
self.logger.debug(f'Message delivery successful: {self.pongReceivedEvent.is_set()}')
if not self.pongReceivedEvent.is_set():