Skip to content

chore: log message id if send queue full instead of full raw message#6263

Open
IronJam11 wants to merge 1 commit intolibp2p:masterfrom
IronJam11:aaryan-issue-6252
Open

chore: log message id if send queue full instead of full raw message#6263
IronJam11 wants to merge 1 commit intolibp2p:masterfrom
IronJam11:aaryan-issue-6252

Conversation

@IronJam11
Copy link

Description

Fixes #6252

Reduce log size for "Send Queue full" warnings by avoiding printing large message data.

Previously, when the send queue was full, the warning log would print the entire RpcOut using its Debug implementation, which included the complete RawMessage with potentially massive byte arrays (data, signature, key fields). In high-traffic scenarios, this resulted in extremely large log files and unnecessary disk I/O.

This PR introduces a RpcLog wrapper struct with a custom Debug implementation that:

  • For Publish and Forward variants: logs only the essential debugging information (message_id, topic, source, sequence_number, validated) while omitting the large byte arrays (data, signature, key, and timeout)
  • For other variants (Subscribe, Unsubscribe, Graft, Prune, IHave, IWant, IDontWant): logs normally as they don't contain large data

This change significantly reduces log file sizes in high-load scenarios while maintaining all useful debugging information for troubleshooting.

Notes & open questions

The timeout field (a Delay type) is also omitted from the log output for Publish and Forward variants. While this field could be useful for debugging, the Delay type doesn't have a human-readable debug representation that shows the deadline, so including it wouldn't add much value to the logs.

All existing tests pass with these changes.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

chore: log message id if send queue is full instead of full raw message
@IronJam11 IronJam11 changed the title [CHORE]: log message id if send queue full instead of full raw message chore: log message id if send queue full instead of full raw message Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

log message id if send queue full instead of full raw message

1 participant