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: Cannot start the zookeeper client in a Node.js Worker thread #310

Merged
merged 1 commit into from
Apr 16, 2022

Conversation

deepcoldy
Copy link

Description

replace all uv_default_loop() by Nan::GetCurrentEventLoop()
here's GetCurrentEventLoop source code

Motivation and Context

Related to #281
The problem is uv_default_loop() return the main Node thread when program started, not the Worker's Event Loop in its isolated environment

How Has This Been Tested?

same as #281

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

@DavidVujic
Copy link
Collaborator

This is great, thank you @deepcoldy!
I'll have a look and will try this out during the weekend.

@DavidVujic DavidVujic self-requested a review April 14, 2022 06:00
@DavidVujic
Copy link
Collaborator

Starting zookeeper from a worker thread seems to work well with this change. 👏

I think it still is some work to make it work starting several instances in different worker threads, though. As an example, I still need to set the Ava test tool to not run in worker threads (in package.json).

But this change is a step in the right direction, and solves the issues described in #281

Nice job, thank you! 🚀

I will merge this one and build a new release within the next couple of days.

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.

2 participants