Attention is currently required from: fixeria.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/27761 )
Change subject: tests/amr: add a unit test for amr_parse_mr_conf()
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/27761
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Iab7e8878e62f598959e80fcb7e729b7f496962a2
Gerrit-Change-Number: 27761
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 14 Apr 2022 16:49:39 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-uecups/+/27769 )
Change subject: tun_device: Avoid deadlocks logging while thread is cancelled
......................................................................
tun_device: Avoid deadlocks logging while thread is cancelled
We cannot garantee that LOGP will not end up calling a syscall which can
be a cancellation point. Since the syscall will be probably called while
having the logging mutex locked, an eventuall cancellation of the thread
would leave the logging mutex locked forever, hence making all other
threads deadlock as soon as they try to write anything to the log.
Change-Id: I72a0b536c8f39857960f132a5b84cdf5b8519732
---
M daemon/tun_device.c
1 file changed, 11 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
diff --git a/daemon/tun_device.c b/daemon/tun_device.c
index 5993856..e9c0400 100644
--- a/daemon/tun_device.c
+++ b/daemon/tun_device.c
@@ -139,12 +139,17 @@
uint8_t *buffer = base_buffer + sizeof(struct gtp1_header);
struct sockaddr_storage daddr;
+ int old_cancelst_unused;
/* initialize the fixed part of the GTP header */
gtph->flags = 0x30;
gtph->type = GTP_TPDU;
pthread_cleanup_push(tun_device_pthread_cleanup_routine, tun);
+ /* IMPORTANT!: All logging functions in this function block must be called with
+ * PTHREAD_CANCEL_DISABLE set, otherwise the thread could be cancelled while
+ * holding the logging mutex, hence causing deadlock with main (or other)
+ * thread. */
while (1) {
struct gtp_tunnel *t;
@@ -154,6 +159,7 @@
/* 1) read from tun */
rc = read(tun->fd, buffer, MAX_UDP_PACKET);
if (rc < 0) {
+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old_cancelst_unused);
LOGTUN(tun, LOGL_FATAL, "Error readingfrom tun device: %s\n", strerror(errno));
exit(1);
}
@@ -162,8 +168,10 @@
rc = parse_pkt(&pinfo, buffer, nread);
if (rc < 0) {
+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old_cancelst_unused);
LOGTUN(tun, LOGL_NOTICE, "Error parsing IP packet: %s\n",
osmo_hexdump(buffer, nread));
+ pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &old_cancelst_unused);
continue;
}
@@ -181,7 +189,9 @@
getnameinfo((const struct sockaddr *)&pinfo.saddr,
sizeof(pinfo.saddr), host, sizeof(host), port, sizeof(port),
NI_NUMERICHOST | NI_NUMERICSERV);
+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old_cancelst_unused);
LOGTUN(tun, LOGL_NOTICE, "No tunnel found for source address %s:%s\n", host, port);
+ pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &old_cancelst_unused);
continue;
}
outfd = t->gtp_ep->fd;
@@ -193,6 +203,7 @@
rc = sendto(outfd, base_buffer, nread+sizeof(*gtph), 0,
(struct sockaddr *)&daddr, sizeof(daddr));
if (rc < 0) {
+ pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &old_cancelst_unused);
LOGTUN(tun, LOGL_FATAL, "Error Writing to UDP socket: %s\n", strerror(errno));
exit(1);
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-uecups/+/27769
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-uecups
Gerrit-Branch: master
Gerrit-Change-Id: I72a0b536c8f39857960f132a5b84cdf5b8519732
Gerrit-Change-Number: 27769
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Hoernchen <ewild(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: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcap/+/27793 )
Change subject: client: Increase wqueue transmit length
......................................................................
client: Increase wqueue transmit length
Having a length of 10 packets is too low, it can be filled easily under
high load or really bursty traffic, where the input path could be polled
multiple times while the output path (write socket poll) is not called.
Related: SYS#5921
Change-Id: I72babfcc31e12624f30c16450dafd988192148be
---
M src/osmo_client_core.c
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/src/osmo_client_core.c b/src/osmo_client_core.c
index 59a6777..8209afe 100644
--- a/src/osmo_client_core.c
+++ b/src/osmo_client_core.c
@@ -341,7 +341,7 @@
{
conn->client = client;
conn->tls_verify = true;
- osmo_wqueue_init(&conn->wqueue, 10);
+ osmo_wqueue_init(&conn->wqueue, 1000);
conn->wqueue.bfd.fd = -1;
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/27793
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-Change-Id: I72babfcc31e12624f30c16450dafd988192148be
Gerrit-Change-Number: 27793
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged