dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/32392 )
Change subject: e1d: do not set fd number to 0 after close
......................................................................
e1d: do not set fd number to 0 after close
0 is reserved for STDIN, so lets not set the file descriptor to 0 after
we close it. Lets use -1 instead.
Change-Id: I72e4775135caf4e3727c4f0654a545478c73bb83
---
M src/input/e1d.c
1 file changed, 16 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/92/32392/1
diff --git a/src/input/e1d.c b/src/input/e1d.c
index 44a710d..01da96d 100644
--- a/src/input/e1d.c
+++ b/src/input/e1d.c
@@ -429,13 +429,13 @@
}
if (bfd->fd) {
close(bfd->fd);
- bfd->fd = 0;
+ bfd->fd = -1;
}
continue;
case E1INP_TS_TYPE_SIGN:
if (bfd->fd > 0 && ts_info[ts].cfg.mode != E1DP_TSMODE_HDLCFCS) {
close(bfd->fd);
- bfd->fd = 0;
+ bfd->fd = -1;
}
if (bfd->fd <= 0) {
bfd->fd = osmo_e1dp_client_ts_open(g_e1d, e1d_intf, e1d_line, ts,
@@ -465,7 +465,7 @@
/* close, if old timeslot mode doesn't match new config */
if (bfd->fd > 0 && ts_info[ts].cfg.mode != E1DP_TSMODE_HDLCFCS) {
close(bfd->fd);
- bfd->fd = 0;
+ bfd->fd = -1;
}
if (bfd->fd <= 0) {
bfd->fd = osmo_e1dp_client_ts_open(g_e1d, e1d_intf, e1d_line, ts,
@@ -489,7 +489,7 @@
/* close, if old timeslot mode doesn't match new config */
if (bfd->fd > 0 && ts_info[ts].cfg.mode != E1DP_TSMODE_RAW) {
close(bfd->fd);
- bfd->fd = 0;
+ bfd->fd = -1;
}
if (bfd->fd <= 0) {
bfd->fd = osmo_e1dp_client_ts_open(g_e1d, e1d_intf, e1d_line, ts,
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/32392
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I72e4775135caf4e3727c4f0654a545478c73bb83
Gerrit-Change-Number: 32392
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: pespin.
dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/32370 )
Change subject: e1d: close fd when osmo_fd_setup fails
......................................................................
Patch Set 2:
(1 comment)
File src/input/e1d.c:
https://gerrit.osmocom.org/c/libosmo-abis/+/32370/comment/136b3c82_f368538b
PS1, Line 513: bfd->fd = 0;
> -1
Then I will fix this in the other code locations as well.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/32370
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I6b41e5ad8511f2d4e524979631a91ab23dc0b23f
Gerrit-Change-Number: 32370
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 20 Apr 2023 15:07:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: laforge, keith.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-abis/+/32374
to look at the new patch set (#3).
Change subject: e1d: reconnect to osmo-e1d after connection loss
......................................................................
e1d: reconnect to osmo-e1d after connection loss
When osmo-e1d crashes while a line is in use the client process may
experience not only a lost connection, it may also hang up in an endless
loop that would also spam the logfile. The reason for this is that the
e1d driver in libosmo-abis lacks mechanisms to detect when the
connection to osmo-e1d gets lost.
When osmo-e1d goes down the effects should be similar to those of a
normal connection loss of an e1 line (cable pulled). So let's add an FSM
that takes care of the recovery of the connection when it is lost. Also
make sure that no havoc happens when the connection gets lost.
Related: OS#5983
Change-Id: Iaf4d42c2f009b1d7666e319fabdeb2598aa0b338
---
M src/input/e1d.c
1 file changed, 253 insertions(+), 13 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/74/32374/3
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/32374
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Iaf4d42c2f009b1d7666e319fabdeb2598aa0b338
Gerrit-Change-Number: 32374
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: keith <keith(a)rhizomatica.org>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: keith <keith(a)rhizomatica.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: pespin.
Hello Jenkins Builder, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-abis/+/32370
to look at the new patch set (#2).
Change subject: e1d: close fd when osmo_fd_setup fails
......................................................................
e1d: close fd when osmo_fd_setup fails
When osmo_fd_register() fails we just exit but the file descriptor stays
open. A file descriptor in this state does not work. Let's close the file
descriptor
Change-Id: I6b41e5ad8511f2d4e524979631a91ab23dc0b23f
---
M src/input/e1d.c
1 file changed, 15 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/70/32370/2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/32370
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I6b41e5ad8511f2d4e524979631a91ab23dc0b23f
Gerrit-Change-Number: 32370
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: laforge, keith.
dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/32374 )
Change subject: e1d: reconnect to osmo-e1d after connection loss
......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS2:
> I suppose because the issue being attended to here was observed and reported in libosmo-abis using a […]
Its a problem with the e1d driver in libosmo-e1d. The file descriptors used to exchange the data on the E1 timeslots are under the control of libosmo-abis (in the line data struct). Also this part of the implementation has to interface between the way libosmo-abis manages the E1 line and osmo-e1d. This is already very application specific.
It is true, each application using the osmo-e1d client has the same problem but the problem is no different from handling any other socket connection.
One could still think to re-design the API towards osmo-e1d to hide everything socket specific from the API user. Basically the driver would be outsourced to libosmo-e1d and replaced with a minimalistic version that just calls API functions and handles some context. Basically we would have some kind of middle layer between libosmo-abis and the original libosmo-e1d API. I am not sure, this might be overcomplicated. (at least the generation of the EV_CONN_LOST might become easier since we could tie that to the control socket)
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/32374
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Iaf4d42c2f009b1d7666e319fabdeb2598aa0b338
Gerrit-Change-Number: 32374
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: keith <keith(a)rhizomatica.org>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: keith <keith(a)rhizomatica.org>
Gerrit-Comment-Date: Thu, 20 Apr 2023 15:07:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: keith <keith(a)rhizomatica.org>
Gerrit-MessageType: comment