laforge submitted this change.
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(-)
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;
}
To view, visit change 39140. To unsubscribe, or for help writing mail filters, visit settings.