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(resource_down): double check ownership #172

Merged
merged 2 commits into from
Jan 24, 2023

Conversation

qzhuyan
Copy link
Collaborator

@qzhuyan qzhuyan commented Jan 20, 2023

After controlling_process/2 call, the old owner is demonitored asynchronously. That is we may get a stream/conn resource_down callback with the pid of old owner while the new ower is already set in the resource ctx.

This change double check if the resource owner is the dead process pid and shutdown the resource only when they match.

After controlling_process/2 call, the old owner is demonitored
*asynchronously*. That is we may get a stream/conn resource_down
callback with the pid of old owner while the new ower is already
set in the resource ctx.

This change double check if the resource owner is the dead process
pid and shutdown the resource only when they match.
github-actions[bot]
github-actions bot previously approved these changes Jan 20, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeball: LGTM! 👍

confidence: 0.98 | [dashboard]

test/quicer_SUITE.erl Outdated Show resolved Hide resolved
@qzhuyan qzhuyan force-pushed the dev/fix/res-down-callback-double-check-dead-pid branch from 580707f to 290118e Compare January 22, 2023 08:09
@qzhuyan qzhuyan marked this pull request as ready for review January 24, 2023 09:10
@qzhuyan qzhuyan merged commit 07b4863 into main Jan 24, 2023
@qzhuyan qzhuyan deleted the dev/fix/res-down-callback-double-check-dead-pid branch March 7, 2023 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants