neels submitted this change.

View Change



3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.

Approvals: pespin: Looks good to me, approved laforge: Looks good to me, but someone else must approve Jenkins Builder: Verified
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(-)

diff --git a/src/osmo-hnbgw/nft_kpi.c b/src/osmo-hnbgw/nft_kpi.c
index 9eff35e..09b9d3b 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: 4
Gerrit-Owner: neels <nhofmeyr@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged