Handle abnormal MySQL structure_load death gracefully#723
Merged
greg-rychlewski merged 7 commits intoelixir-ecto:masterfrom Mar 29, 2026
Merged
Handle abnormal MySQL structure_load death gracefully#723greg-rychlewski merged 7 commits intoelixir-ecto:masterfrom
greg-rychlewski merged 7 commits intoelixir-ecto:masterfrom
Conversation
josevalim
reviewed
Mar 29, 2026
lib/ecto/adapters/myxql.ex
Outdated
| ] | ||
|
|
||
| # Trap exits in case mysql dies in the middle of execution so that we can surface the error | ||
| Process.flag(:trap_exit, true) |
Member
There was a problem hiding this comment.
Do we need to trap exits? I am not sure if ports in Erlang are linked to the current process. But if we do have, we should probably revert the trap_exit flag to its original value once we are done!
Member
Author
There was a problem hiding this comment.
I believe so but definitely not an expert. I originally got it from the erlang docs example here: https://www.erlang.org/doc/system/c_port.html.
I also did a test here where I ignore the "normal" exist message and also don't trap exits and I didn't receive the abnormal exit message.
Member
Author
There was a problem hiding this comment.
we should probably revert the trap_exit flag to its original value once we are done!
done!
josevalim
approved these changes
Mar 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #721