status: suppress status_trace/status_debug messages if queue too long.

We can be spammy, which is good for tests, but bad for our simple message queue.
This avoids breaking our tests but also avoid the worst case (1M entries and counting!)
for gossip status messages in the case where we're syncing a large peer.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-05-02 10:25:17 +09:30
committed by Christian Decker
parent e3bac6c165
commit ec658c1f89
5 changed files with 39 additions and 0 deletions

View File

@@ -15,6 +15,9 @@ struct msg_queue *msg_queue_new(const tal_t *ctx);
/* If add is taken(), freed after sending. msg_wake() implied. */
void msg_enqueue(struct msg_queue *q, const u8 *add TAKES);
/* Get current queue length */
size_t msg_queue_length(const struct msg_queue *q);
/* Fd is closed after sending. msg_wake() implied. */
void msg_enqueue_fd(struct msg_queue *q, int fd);