Skip to content

Fix Call Home reconnect - #626

Merged
michalvasko merged 3 commits into
develfrom
ch-reconnect-fix
Aug 17, 2026
Merged

Fix Call Home reconnect#626
michalvasko merged 3 commits into
develfrom
ch-reconnect-fix

Conversation

@Roytak

@Roytak Roytak commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

The Call Home reconnect wait used a condition variable, which could not monitor the pending socket. If the TCP handshake completed during the wait and the peer then closed, the dead socket was passed to the SSH/TLS handshake, causing: SSH key exchange error (Socket error: No such file or directory).

Replace the cond var with a self-pipe so poll() can wait on both the stop signal and the pending socket simultaneously. A peer-closed pending socket is now detected via POLLHUP/POLLERR and discarded before reaching the handshake.

Also moves sock_pending out of the endpoint config struct to a thread-local variable, fixing a leak when the endpoint was removed mid-connection.

Fixes #625

Roytak added 3 commits August 17, 2026 11:06
Use a self-pipe instead of a cond var to allow poll()ing the pending
Call Home socket during the reconnect wait. Detects when the peer
closes a pending connection and prevents dead sockets from reaching
the SSH/TLS handshake.

Fixes #625
@michalvasko
michalvasko merged commit 0df75c6 into devel Aug 17, 2026
11 checks passed
@michalvasko
michalvasko deleted the ch-reconnect-fix branch August 17, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants