pespin has uploaded this change for review. ( 
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(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/40/39140/1

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 https://gerrit.osmocom.org/c/libosmocore/+/39140?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia712af2041241ea6aa0e03818908fd295d157fd2
Gerrit-Change-Number: 39140
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>

Reply via email to