Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix stop return from gen_statem init #697

Merged

Conversation

greg-rychlewski
Copy link
Member

When I was testing durations I kept seeing logs like this while running the tests

07:40:52.702 [error] :gen_statem #PID<0.1557.0> terminating
** (stop) {:bad_return_from_init, {:stop, %Postgrex.Error{message: nil, postgres: %{code: :invalid_catalog_name, file: "postinit.c", line: "877", message: "database \"nobody_knows_it\" does not exist", pg_code: "3D000", routine: "InitPostgres", severity: "FATAL", unknown: "FATAL"}, connection_id: nil, query: nil}, %Postgrex.SimpleConnection{idle_interval: 5000, protocol: nil, auto_reconnect: false, reconnect_backoff: 500, state: {Postgrex.Notifications, %Postgrex.Notifications{from: nil, ref: nil, auto_reconnect: false, connected: false, listeners: %{}, listener_channels: %{}}}}}}

Checking the erlang docs it seems like {:stop, reason} should be returned here. The logs don't show up before 1.17 though. I'm guessing due to better error reporting but I'm not 100% sure.

@greg-rychlewski greg-rychlewski changed the title Fix stop return from gen_statem Fix stop return from gen_statem init Jul 26, 2024
@greg-rychlewski greg-rychlewski merged commit 6756640 into elixir-ecto:master Jul 26, 2024
9 checks passed
@greg-rychlewski greg-rychlewski deleted the genstatem_init_stop branch July 26, 2024 14:27
@hauleth
Copy link
Contributor

hauleth commented Aug 2, 2024

Could it be released as a patch version to Postgrex?

@josevalim
Copy link
Member

v0.19.0 is out.

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.

3 participants