Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmocore/+/41702?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: logging_vty: Allow setting gsmtap log tgt as (blocking-io|nonblocking-io|wq)
......................................................................
logging_vty: Allow setting gsmtap log tgt as (blocking-io|nonblocking-io|wq)
The current patch adds the possibility to configure it, and leaves the
previous behavior as default: blocking-io.
Related: OS#6213
Change-Id: Id5d31bedd7d265d18f6e475ccbc94ced80598d04
---
M TODO-RELEASE
M include/osmocom/core/gsmtap_util.h
M include/osmocom/core/socket.h
M src/core/gsmtap_util.c
M src/core/libosmocore.map
M src/core/socket.c
M src/vty/logging_vty.c
7 files changed, 87 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/02/41702/2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41702?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id5d31bedd7d265d18f6e475ccbc94ced80598d04
Gerrit-Change-Number: 41702
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/41703?usp=email )
Change subject: logging_vty: Set 'gsmtap log nonblocking-io' as default
......................................................................
logging_vty: Set 'gsmtap log nonblocking-io' as default
Apps using a VTY are expected to be using an event loop, and hence
should not be using blocking operations which would stall the event
loop.
If user fears losing messages (eg, when enabling a lot of DEBUG),
then the taget can still be switched to "wq" at the expense of
losing performance, or increasing the kernel UDP socket sndbuf by means
of sysctl net.core.wmem_{default,max}.
Related: OS#6213
Related: OS#6794
Change-Id: Ifca8a821e13ec1327ab2476b0db91078fcff948b
---
M src/vty/logging_vty.c
1 file changed, 7 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/03/41703/1
diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c
index 1c030b5..77b09d8 100644
--- a/src/vty/logging_vty.c
+++ b/src/vty/logging_vty.c
@@ -815,13 +815,13 @@
"log gsmtap [HOSTNAME] [(nonblocking-io|blocking-io|wq)]",
LOG_STR "Logging via GSMTAP\n"
"Host name to send the GSMTAP logging to (UDP port 4729)\n"
- "Use non-blocking, synchronous I/O (may lose msgs if UDP sndbuf becomes full)\n"
- "Use blocking, synchronous I/O (only for debug purposes or when blocking is acceptable) (default)\n"
+ "Use non-blocking, synchronous I/O (may lose msgs if UDP sndbuf becomes full) (default)\n"
+ "Use blocking, synchronous I/O (only for debug purposes or when blocking is acceptable)\n"
"Use Tx workqueue, asynchronous I/O (may lose msgs if queue becomes full)\n")
{
const char *hostname = argc > 0 ? argv[0] : "127.0.0.1";
bool ofd_wq_mode = argc > 1 && (strcmp(argv[1], "wq") == 0);
- bool nonblocking_io = argc > 1 && (strcmp(argv[1], "nonblocking-io") == 0);
+ bool blocking_io = argc > 1 && (strcmp(argv[1], "blocking-io") == 0);
struct log_target *tgt;
log_tgt_mutex_lock();
@@ -835,7 +835,7 @@
hostname, VTY_NEWLINE);
RET_WITH_UNLOCK(CMD_WARNING);
}
- if (!ofd_wq_mode && nonblocking_io) {
+ if (!ofd_wq_mode && !blocking_io) {
int rc = gsmtap_source_set_nonblock(tgt->tgt_gsmtap.gsmtap_inst, 1);
if (rc != 0)
vty_out(vty, "%% Unable to configre GSMTAP log for %s as nonblocking-io%s",
@@ -850,7 +850,7 @@
}
if (!ofd_wq_mode) {
int fd = gsmtap_inst_fd2(tgt->tgt_gsmtap.gsmtap_inst);
- if (fd > 0 && osmo_sock_get_nonblock(fd) != nonblocking_io) {
+ if (fd > 0 && !osmo_sock_get_nonblock(fd) != blocking_io) {
vty_out(vty, "%% Remove and re-add the log gsmtap target in order to "
"change between blocking and non-blocking IO%s", VTY_NEWLINE);
RET_WITH_UNLOCK(CMD_WARNING);
@@ -1071,8 +1071,8 @@
pars = " wq";
} else {
int fd = gsmtap_inst_fd2(tgt->tgt_gsmtap.gsmtap_inst);
- if (fd > 0 && osmo_sock_get_nonblock(fd))
- pars = " nonblocking-io";
+ if (fd > 0 && !osmo_sock_get_nonblock(fd))
+ pars = " blocking-io";
else
pars = "";
}
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41703?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: Ifca8a821e13ec1327ab2476b0db91078fcff948b
Gerrit-Change-Number: 41703
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Attention is currently required from: pespin.
daniel has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmocore/+/41701?usp=email )
Change subject: gsmtap_util: Fix fds not closed in ofd_wq_mode=0
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41701?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I55fd51066d22261cf89fbf9501bec3af743a641d
Gerrit-Change-Number: 41701
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 17 Dec 2025 15:58:25 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: laforge, pespin.
daniel has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmocore/+/41700?usp=email )
Change subject: gsmtap_util: Get rid of unused wq
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41700?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I4f1cf168c230471a6d7be4bb065d7105a993349f
Gerrit-Change-Number: 41700
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 17 Dec 2025 15:53:58 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/41694?usp=email )
Change subject: trx_toolkit: UDPLink: catch and ignore BlockingIOError
......................................................................
trx_toolkit: UDPLink: catch and ignore BlockingIOError
We should not crash when failing to send a datagram due to blocking.
Print an error, drop the data, and keep going.
Change-Id: If2248d4a670f893848c44e0fcbd2089371532207
Related: OS#6904
---
M src/target/trx_toolkit/udp_link.py
1 file changed, 8 insertions(+), 2 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/target/trx_toolkit/udp_link.py b/src/target/trx_toolkit/udp_link.py
index 4db7283..f0a8224 100644
--- a/src/target/trx_toolkit/udp_link.py
+++ b/src/target/trx_toolkit/udp_link.py
@@ -17,6 +17,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
+import logging as log
import socket
class UDPLink:
@@ -45,5 +46,10 @@
def sendto(self, data, remote):
if type(data) not in [bytearray, bytes]:
data = data.encode()
-
- self.sock.sendto(data, remote)
+ try:
+ self.sock.sendto(data, remote)
+ except BlockingIOError:
+ # When the message does not fit into the send buffer of the socket, send()
+ # normally blocks, unless the socket has been placed in nonblocking I/O mode.
+ # In nonblocking mode it would fail with the BlockingIOError in this case.
+ log.error('(%s) BlockingIOError: dropping Tx data', self.desc_link())
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/41694?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: If2248d4a670f893848c44e0fcbd2089371532207
Gerrit-Change-Number: 41694
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>