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

Unhandled gen_statem Timout Event #648

Closed
aj-foster opened this issue Apr 12, 2023 · 0 comments · Fixed by #650
Closed

Unhandled gen_statem Timout Event #648

aj-foster opened this issue Apr 12, 2023 · 0 comments · Fixed by #650
Labels

Comments

@aj-foster
Copy link

Elixir version

1.14.2 on OTP 25.2

Database and Version

PostgreSQL 14.1

Postgrex Version

0.17.0

Current behavior

Hello there 👋🏼

In #643, Postgrex began using gen_statem in Postgrex.SimpleConnection. There appears to be an unhandled timeout event.

When I run tests for my application (which uses Oban — which uses NOTIFY), the following error occurs:

** (FunctionClauseError) no function clause matching in Postgrex.SimpleConnection.handle_event/4
    (postgrex 0.17.0) lib/postgrex/simple_connection.ex:340: Postgrex.SimpleConnection.handle_event(:timeout, nil, :no_state, %Postgrex.SimpleConnection{...})
    (stdlib 4.2) gen_statem.erl:1428: :gen_statem.loop_state_callback/11
    (stdlib 4.2) proc_lib.erl:240: :proc_lib.init_p_do_apply/3

The documentation for gen_statem lists three timeout event types:

timeout | {timeout, Name :: term()} | state_timeout

However, I only see a handler for {:timeout, :backoff}.

If it's useful, I'm using Oban 2.14.2, though I believe the problem is internal to Postgrex and gen_statem.

Expected behavior

I believe this type of :timeout event is normal (and should be handled), but I'm too unfamiliar with gen_statem to know for sure.

❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant