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(pool): forcefully recreate pool if already exists #54

Merged
merged 2 commits into from
Jul 1, 2024

Conversation

keynslug
Copy link
Contributor

@keynslug keynslug commented Jul 1, 2024

There are (extremely rare) situations when a pool that is under control of the gproc_pool server may end up in an inconsistent state. This is possible because gproc_pool:new/3 involves a sequence of operations against gproc state, so the whole change is not atomic. In extreme conditions, one of the operations may fail, kill the gproc_pool server and leave the pool state inconsistent. The reasonable (and advertised) way to deal with it is to force_delete/1 it first. This should be safe as the assumption is that an ehttpc_pool owns its gproc_pool.

zmstone
zmstone previously approved these changes Jul 1, 2024
keynslug added 2 commits July 1, 2024 17:47
There are (extremely rare) situations when a pool that is under control
of the `gproc_pool` server may end up in an inconsistent state. This
is possible because `gproc_pool:new/3` involves a sequence of operations
against `gproc` state, and this sequence is not atomic. In extreme
conditions, one of the operations may fail, kill the `gproc_pool` server
and leave the pool state inconsistent. The reasonable (and advertised)
way to deal with it is to `force_delete` it first. This should be safe
as the assumption is that an `ehttpc_pool` owns its `gproc_pool`.
@keynslug keynslug force-pushed the fix/EMQX-12421/recreate branch from 959ea68 to c05d57f Compare July 1, 2024 15:48
@keynslug keynslug requested a review from zmstone July 1, 2024 15:55
@keynslug keynslug merged commit 9a9db3f into emqx:main Jul 1, 2024
2 checks passed
@keynslug keynslug deleted the fix/EMQX-12421/recreate branch July 1, 2024 17:15
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