connectd: drop excess gossipd messages.

We haven't seen the "excessive queue length" backtrace since we fixed gossipd,
so it's safe to drop excess messages without worrying about losing gossip.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2025-08-17 09:38:51 +09:30
parent 3015bfcf4b
commit 0456bace5d

View File

@@ -742,7 +742,13 @@ static void handle_pong_in(struct peer *peer, const u8 *msg)
/* Forward to gossipd */
static void handle_gossip_in(struct peer *peer, const u8 *msg)
{
u8 *gmsg = towire_gossipd_recv_gossip(NULL, &peer->id, msg);
u8 *gmsg;
/* We warn at 250000, drop at 500000 */
if (daemon_conn_queue_length(peer->daemon->gossipd) > 500000)
return;
gmsg = towire_gossipd_recv_gossip(NULL, &peer->id, msg);
/* gossipd doesn't log IO, so we log it here. */
status_peer_io(LOG_IO_IN, &peer->id, msg);