laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/39140?usp=email )
Change subject: osmo_io: Log current queue length upon enqueue failure ......................................................................
osmo_io: Log current queue length upon enqueue failure
Change-Id: Ia712af2041241ea6aa0e03818908fd295d157fd2 --- M src/core/osmo_io.c 1 file changed, 4 insertions(+), 3 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved osmith: Looks good to me, but someone else must approve
diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c index d1767d2..e109cdf 100644 --- a/src/core/osmo_io.c +++ b/src/core/osmo_io.c @@ -209,8 +209,11 @@ */ int iofd_txqueue_enqueue(struct osmo_io_fd *iofd, struct iofd_msghdr *msghdr) { - if (iofd->tx_queue.current_length >= iofd->tx_queue.max_length) + if (iofd->tx_queue.current_length >= iofd->tx_queue.max_length) { + LOGPIO(iofd, LOGL_ERROR, "enqueueing message failed (queue full, %u msgs). Rejecting msgb\n", + iofd->tx_queue.current_length); return -ENOSPC; + }
llist_add_tail(&msghdr->list, &iofd->tx_queue.msg_queue); iofd->tx_queue.current_length++; @@ -520,7 +523,6 @@ rc = iofd_txqueue_enqueue(iofd, msghdr); if (rc < 0) { iofd_msghdr_free(msghdr); - LOGPIO(iofd, LOGL_ERROR, "enqueueing message failed (%d). Rejecting msgb\n", rc); return rc; }
@@ -596,7 +598,6 @@ rc = iofd_txqueue_enqueue(iofd, msghdr); if (rc < 0) { iofd_msghdr_free(msghdr); - LOGPIO(iofd, LOGL_ERROR, "enqueueing message failed (%d). Rejecting msgb\n", rc); return rc; }