-
Notifications
You must be signed in to change notification settings - Fork 22
Switch to gen_statem #25
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
Conversation
test/connection_test.exs
Outdated
| assert_receive {:terminate, 1} | ||
| assert_receive {:EXIT, ^pid, {:shutdown, _}} | ||
| Logger.flush() | ||
| end) =~ ~r"error.*GenServer.*\(stop\) shutdown: #Function.*State: 1"sm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@josevalim do we still need to do something like this, or is this related to proc_lib/gen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message can change, yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, but in particular I mean, do we still need to do manual logging here? I thought that by implementing format_status to return only the Connection module state (rather than the gen_statem state), we'd be fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would perhaps drop the additional logging because both format_status and the logging API changed on OTP since this project was released.
|
@josevalim fantastic. Tests are passing over here π |
|
I was just looking into this library and it looks good but unmaintained, and complex because of the use of |
|
@hkrutzer the library is not unmaintained. |
|
However, it might go unmaintained based on elixir-ecto/db_connection#275. :D Because it may be that rolling your own with |
|
Super duper agreed: this PR is complex and risky. Switching db_connection to gen_statem is easier and makes more sense, so let's avoid touching this π |
This is a work-in-progress to move Connection from being a GenServer underneath to being a gen_statem. This allows us to simplify the code and not use
genandproc_libAPIs.