apache / apache/mynewt-nimble

Host stuck in connecting state after timeout

Open
#1,948 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
893
Forks
512
Avg merge
13d 31m
Merged PRs (30d)
7

Description

Occasionally we get host stuck in a connecting state, where a connection that timed out has not been cleaned up.
In fact, in the post-mortem memory dump examination it looks exactly as the condition described in [this TODO](https://github.com/apache/mynewt-nimble/blob/895ed28b99080cef86828c3629fe53b4f80004e3/nimble/host/src/ble_gap.c#L2247-L2248): ble_gap_master.exp_set is 0, but cb and cb_arg are still set, suggesting that conn_complete never arrived.
If would be nice to have the remedial action implmeneted as described - an additional timeout and a controller reset.

FWIW, platform is ESP32-C3 with BLE_EXT_ADV enabled. And there's a suspicion that it only occurs when BLE_EXT_ADV is enabled, since it wasn't happening before.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in nimble/host/src/ble_gap.c at the TODO around lines 2247-2248, tracing ble_gap_master.exp_set, cb, cb_arg, and conn_complete through the timeout path. Check the ESP32-C3 and BLE_EXT_ADV behavior described in the report. Done means an additional timeout and controller reset remediate the missing conn_complete case so the host no longer remains in the connecting state.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.