Skip to content

Reconnect when the connection drops during a handle_connect query - #805

Merged
josevalim merged 1 commit into
elixir-ecto:masterfrom
Don-Yin:fix-reconnect-in-handle-connect
Oct 28, 2026
Merged

josevalim merged 1 commit into
elixir-ecto:masterfrom
Don-Yin:fix-reconnect-in-handle-connect

Conversation

@Don-Yin

@Don-Yin Don-Yin commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

When the query returned from handle_connect/1 lost its connection, handle_event(:internal, {:connect, _}, ...) only matched {:keep_state, state, _} from maybe_handle/4 and dropped its actions, so the reconnect never happened and the process stayed up without receiving notifications. I now return what maybe_handle/4 gives back, and added a test whose handle_connect/1 terminates its own backend.

Fixes #800

The full suite passes locally.

screenshot

Signed-off-by: Don Yin <Don_Yin@outlook.com>
@josevalim
josevalim merged commit 0f445f7 into elixir-ecto:master Oct 28, 2026
13 checks passed
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.

SimpleConnection: a disconnect during handle_connect's query drops the reconnect, leaving an auto_reconnect connection disconnected for good

2 participants