pespin submitted this change.

View Change

Approvals: laforge: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified
stream_cli: Log all code paths ending up in close/reconnect

This way it's possible to track why a connection was closed od/and
reconnected (depending on reconnect config set by user).

Change-Id: I6debc5de193d99919fe858befd905223ef965d81
---
M src/stream_cli.c
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/stream_cli.c b/src/stream_cli.c
index 757de1c..25dda4f 100644
--- a/src/stream_cli.c
+++ b/src/stream_cli.c
@@ -353,11 +353,13 @@
OSMO_ASSERT(fd >= 0);

if (ret < 0) {
+ LOGSCLI(cli, LOGL_ERROR, "connect failed (%d)\n", res);
osmo_stream_cli_reconnect(cli);
return;
}
ret = getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len);
if (ret >= 0 && error > 0) {
+ LOGSCLI(cli, LOGL_ERROR, "connect so_error (%d)\n", error);
osmo_stream_cli_reconnect(cli);
return;
}
@@ -895,6 +897,7 @@
}

if (ret < 0) {
+ LOGSCLI(cli, LOGL_ERROR, "connect: socket creation error (%d)\n", ret);
if (reconnect)
osmo_stream_cli_reconnect(cli);
return ret;
@@ -1001,6 +1004,7 @@
}

if (ret < 0) {
+ LOGSCLI(cli, LOGL_ERROR, "connect: socket creation error (%d)\n", ret);
osmo_stream_cli_reconnect(cli);
return ret;
}

To view, visit change 38892. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I6debc5de193d99919fe858befd905223ef965d81
Gerrit-Change-Number: 38892
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>