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

Use domain.bind to preserve domain context #152

Merged
merged 1 commit into from Oct 15, 2016

Conversation

LewisJEllis
Copy link
Contributor

@LewisJEllis LewisJEllis commented Oct 12, 2016

This is a case of the userland queueing problem. We don't have automatic implicit binding here, so we need to do explicit binding, as described in the domain docs.

I'm aware that domains are deprecated, people should avoid using them, a replacement is coming, etc, but there are use cases where they are absolutely necessary and losing the domain context can lead to state mismatches. This fix will be helpful for any projects that use node-pool (or anything depending on node-pool) and any sort of domain context pattern (or any of several error reporting and APM tools which do).

For reference, the widely-used redis, cassandra, mysql, and postgres drivers handle this correctly, among others.

@sandfox
Copy link
Collaborator

sandfox commented Oct 14, 2016

Thanks for this, I'm not very familiar with domains, so I'm going to trust this makes sense. (I've done some reading of the docs and it looks about right)

I'm currently working on v3 of the pool, but I'll try and get this and some other fixes released this weekend.

@sandfox sandfox self-assigned this Oct 14, 2016
@LewisJEllis
Copy link
Contributor Author

Sounds great, thanks!

If you're looking to understand domains a bit more, I can recommend this post for a good primer (less referencey than the docs). I also put together some related examples/explanations here if you want to explore the cases that this solves.

@sandfox sandfox merged commit 1ba461b into coopernurse:master Oct 15, 2016
@LewisJEllis
Copy link
Contributor Author

Thanks for the merge & release!

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.

None yet

2 participants