neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/37187?usp=email )

 (

3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
 )Change subject: nft-kpi: log errors of counter retrieval
......................................................................

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(-)

Approvals:
  pespin: Looks good to me, approved
  laforge: Looks good to me, but someone else must approve
  Jenkins Builder: Verified




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 https://gerrit.osmocom.org/c/osmo-hnbgw/+/37187?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I84340482e4a5bfcac158a21c9378a9511fa5ea10
Gerrit-Change-Number: 37187
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofm...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-Reviewer: neels <nhofm...@sysmocom.de>
Gerrit-Reviewer: pespin <pes...@sysmocom.de>
Gerrit-MessageType: merged

Reply via email to