Attention is currently required from: neels.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36540?usp=email )
Change subject: nft_kpi: retrieve counters in a separate thread ......................................................................
Patch Set 3:
(1 comment)
Patchset:
PS3:
Blocking of the main thread can happen with this patch, at the times when the main thread wants to run a quick nft command.
This should NEVER happen. The main loop must not wait/sleep/block waiting for an external program to run, specially for a network program potentially connected to a hundred other peers. This should be done in an async fashion: run the program, get an event loop once it has finished. Also read its stdout/stderr based on event loops from the pipe fd.
It rings a bells we already have something like that somewhere in libosmocore? See libosmocore/include/osmocom/core/exec.h That probably needs to be extended to allow integrating with main loop.
The other solution is ofc having a separate thread and do a blocking fork/exceve/system call, then use the osmo_itq as mentioned to provide back the counters.