Description
In my application, I have implemented a timeout for starting the Golioth client as to not lock it up indefinitely. After this timeout, I trigger a call of golioth_stop_client(). This is all working, however: if I run into said timeout, the stop function seems to not work, and after a few seconds it says the client is connected. Because my application is expecting the client to be off at this point, this leads to a softlock.
In the log I posted the timeout was 10 milliseconds, but it happened with a more normal timeout of 10 seconds as well, it was just easier to reproduce with a super short timeout.
Steps to Reproduce
Stopping the client while it’s still trying to connect to Golioth.
Expected Behavior
The client is stopped.
Actual Behavior
The client is not stopping, and connects eventually.
Impact
Softlocks the device.
Environment
Golioth SDK 0.15.0, NCS 2.5.2, Zephyr 3.6.99
Logs and Console Output
[00:00:05.656,890] libcetus_datatransfer_rq_q: network_dtrqq: Queue provider connected, flushing 1 datatransfers
[00:00:05.657,257] libcetus_datatransfer_rq_q: underlying_request_cb: golioth_dtrqq: Underlying queue (network_dtrqq) called our request
[00:00:05.657,287] libcetus_datatransfer_rq_q: flush: golioth_dtrqq: Flushing the queue now
[00:00:05.657,318] golioth_client: start: Starting the Golioth client
[00:00:05.658,020] golioth_mbox: Mbox created, bufsize: 3696, num_items: 32, item_size: 112
[00:00:05.659,698] golioth_fw_update: Current firmware version: main - 0.2.14
[00:00:05.659,851] golioth_client: Failed to register reboot RPC
[00:00:05.669,982] libcetus_datatransfer_rq_q: golioth_dtrqq: Connection attempt timed out
[00:00:05.670,043] libcetus_datatransfer_rq_q: golioth_dtrqq: Queue provider failed to connect
[00:00:05.670,104] libcetus_datatransfer_rq_q: disconnect_provider: Finishing dtrq on underlying queue (network_dtrqq)
[00:00:05.670,135] libcetus_datatransfer_rq_q: network_dtrqq: All datatransfers completed, timed out or cancelled
[00:00:05.670,196] libcetus_datatransfer_rq_q: golioth_dtrqq: Disconnecting provider
[00:00:05.670,227] golioth_coap_client_zephyr: Attempting to stop client
[00:00:08.300,201] golioth_coap_client_zephyr: Golioth CoAP client connected
[00:00:08.300,262] golioth_client: Golioth client connected