Skip to content

internal/db: Close accept channel before closing dqlite on failed bootstrap or join - #850

Open
claudiubelu wants to merge 3 commits into
canonical:v4from
claudiubelu:v4-join-accept-channel
Open

claudiubelu wants to merge 3 commits into
canonical:v4from
claudiubelu:v4-join-accept-channel

Conversation

@claudiubelu

@claudiubelu claudiubelu commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

When Bootstrap or Join fails, the reverter closes the dqlite app but keeps the accept channel open. The go-dqlite reader ranging over it keeps receiving connections from the remaining cluster members and panics when it cannot dial the closed app's local socket, crashing the daemon before the join failure cleanup can run.

Rotate the accept channel before closing the dqlite app, like Restart already does.

On a failed join, the cluster member handling the cleanup resets the joiner through PUT /cluster/{name}. That endpoint required an open database, which a joiner whose dqlite join failed never has, so the reset was refused and the joiner could not be initialized again until its daemon was restarted.

Adds a failed cluster join test scenario.

…tstrap or join

When Bootstrap or Join fails, the reverter closes the dqlite app but keeps
the accept channel open. The go-dqlite reader ranging over it keeps receiving
connections from the remaining cluster members and panics when it cannot dial
the closed app's local socket, crashing the daemon before the join failure
cleanup can run.

Rotate the accept channel before closing the dqlite app, like Restart already does.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
…ffline

On a failed join, the cluster member handling the cleanup resets the
joiner through PUT /cluster/{name}.

That endpoint required an open database, which a joiner whose dqlite
join failed never has, so the reset was refused and the joiner could
not be initialized again until its daemon was restarted.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
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.

1 participant