neels has uploaded this change for review.

View Change

nft-kpi: log errors of counter retrieval

Make sure errors of getting counters from nft are logged.

Some context: we'll try again each X34 period, hence this is only a
problem when the error persists.

For example, when the get-counters thread is faster than the maintenance
thread can even create the nft table initially, this error will show.

We could add a definite check whether the maintenance thread has created
the tables yet, and wait for that event. But this complexity is not
really needed: it is fine to just fail getting counters once or twice.

Related: SYS#6773
Change-Id: I84340482e4a5bfcac158a21c9378a9511fa5ea10
---
M src/osmo-hnbgw/nft_kpi.c
1 file changed, 30 insertions(+), 1 deletion(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/87/37187/1
diff --git a/src/osmo-hnbgw/nft_kpi.c b/src/osmo-hnbgw/nft_kpi.c
index 5f2359b..4fa932f 100644
--- a/src/osmo-hnbgw/nft_kpi.c
+++ b/src/osmo-hnbgw/nft_kpi.c
@@ -990,7 +990,14 @@
break;

case NFT_THREAD_GET_COUNTERS:
- main_thread_handle_get_counters_resp(req);
+ if (req->rc) {
+ /* Maybe we requested counters before the table was created by the maintenance thread. If so,
+ * it's not harmful and we can just try again next time. */
+ LOGP(DNFT, LOGL_ERROR, "Retrieving counters from nftables failed. Trying again (timer X34).\n");
+ } else {
+ main_thread_handle_get_counters_resp(req);
+ }
+ /* Schedule the next counter retrieval. */
nft_kpi_get_counters_schedule();
break;


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

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I84340482e4a5bfcac158a21c9378a9511fa5ea10
Gerrit-Change-Number: 37187
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr@sysmocom.de>
Gerrit-MessageType: newchange