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

Module doesn't self-register from a worker thread #831

Closed
yura415 opened this issue Aug 12, 2020 · 5 comments
Closed

Module doesn't self-register from a worker thread #831

yura415 opened this issue Aug 12, 2020 · 5 comments
Labels
pinned stale Stale issues

Comments

@yura415
Copy link

yura415 commented Aug 12, 2020

Environment Information

  • OS [e.g. Mac, Arch, Windows 10]: Alpine (docker)
  • Node Version [e.g. 8.2.1]: node:12-alpine
  • NPM Version [e.g. 5.4.2]: v5
  • C++ Toolchain [e.g. Visual Studio, llvm, g++]:
  • node-rdkafka version [e.g. 2.3.3]: 2.8.1

Steps to Reproduce

const {
  Worker, isMainThread
} = require('worker_threads');
const kafka = require('node-rdkafka');

if (isMainThread) {
   // Brand new worker
   new Worker(__filename);
}

Additional context

Even though this issue relates to nodejs internal implementation of workers, nodejs developers wont fix it. However it can be fixed by making native module context-aware. Here is an example for node-lzo: schroffl/node-lzo#11

@chengsu
Copy link

chengsu commented Aug 15, 2020

nodejs/node#21783 (comment) , the solution seems quite simple.

@eduardogmisiuk
Copy link

I'm experiencing the same problem. I'm not directly using the lib in the worker thread, but it is imported with other modules and crashes.

@stale
Copy link

stale bot commented Dec 29, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale Stale issues label Dec 29, 2020
@iradul iradul added pinned and removed stale Stale issues labels Jan 8, 2021
@stale
Copy link

stale bot commented Jun 11, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale Stale issues label Jun 11, 2021
@stale stale bot closed this as completed Jun 26, 2021
@relief-melone
Copy link

any update on this? Still cannot open up workers utilizing node-rdkafka

midnightcodr added a commit to midnightcodr/node-rdkafka that referenced this issue Mar 22, 2024
midnightcodr added a commit to midnightcodr/node-rdkafka that referenced this issue Mar 22, 2024
A workaround for Blizzard#831

upped the version
This was referenced Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pinned stale Stale issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants