Fix satellite heartbeat timeout cleanup and /status blocking
Heartbeat timeout called m_con->disconnect() on a server-managed connection, which didn't trigger TcpServer::clientDisconnected — leaving dead satellites in the map forever. After timeout, the unsigned rx counter wrapped to UINT_MAX preventing re-detection. The timer also kept firing sendMsg() to the dead socket, blocking the event loop and causing /status to stall for ~10s. Fix: SatelliteLink emits linkFailed signal instead of calling disconnect directly. Reflector handles cleanup via a deferred zero-timer to avoid re-entrancy. The /status handler skips satellites pending cleanup. Also disable ALSA in Docker build (unused by the reflector).
This commit is contained in:
1 parent
195be03036
commit
fa57db6e62
5 files changed
+72
-5
No files matched your search
@@ -30,6 +30,13 @@ class SatelliteLink : public sigc::trackable
|
||||
const std::string& satelliteId(void) const { return m_satellite_id; }
|
||||
Json::Value statusJson(void) const;
|
||||
|
||||
/**
|
||||
* Emitted when the satellite link has failed (heartbeat timeout).
|
||||
* The Reflector must handle cleanup — the SatelliteLink stops its own
|
||||
* timer but does NOT call m_con->disconnect() itself.
|
||||
*/
|
||||
sigc::signal<void, SatelliteLink*> linkFailed;
|
||||
|
||||
// Events from local clients or trunk peers → send down to satellite
|
||||
void onParentTalkerStart(uint32_t tg, const std::string& callsign);
|
||||
void onParentTalkerStop(uint32_t tg);
|
||||
|
||||
Reference in new issue
Block a user