-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Worker process not terminated when Babel emits ReferenceError on malformed options #169
Comments
/cc @stefanpenner |
Ah this isn’t good, I’ll take a look. |
Can do, but it'll have to wait until monday when I'm back in the office. 🥳 |
Test results: I'm getting an In hindsight this is not much of a surprise. Event passing between threads is functionally very similar to managing worker processes; if there is a situation where the main node event pump can stall waiting for idle workers, the same can easily happen with threads. |
Ya, with node 11 at least we won’t orphan subprocesses. If you have time to provide a reproduction or failing test, then I can be sure I am fixing the right bug. I should have soon |
I think I am seeing this bug. For me it only strikes on linux, I have yet to reproduce it on osx. |
I've also seen it on OSX.... |
Taking a look now. |
So, I believe:
Is a red herring, the parallel nature of broccoli-babel-transpiler itself has never called terminate on the workerpool it spawns. I believe it relies on the process itself being exited. If memory serves this is due to broccoli no longer calling "cleanup" in individual plugins, which then gives broccoli-persistent-filter no opportunity to shut its workers down. In addition, workers currently can be shared between pipelines, which increases the complexity somewhat. Options:
Next steps:
|
broccoli-babel-transpiler works around this itself:
|
I tried using |
FWIW, this issue is still very frustrating. 😸 Ended up writing my own tiny broccoli babel compiler instead of reaching for the private APIs needed to ensure that the process exits. :( |
@stefanpenner or @rwjblue is there any update on this issue? |
Partial revert of broccolijs#476 to work around babel/broccoli-babel-transpiler#169
Partial revert of broccolijs#476 to work around babel/broccoli-babel-transpiler#169
Partial revert of broccolijs#476 to work around babel/broccoli-babel-transpiler#169
Partial revert of broccolijs#476 to work around babel/broccoli-babel-transpiler#169
@MelSumner other then work-arounds, the root cause is in broccoli proper and most likely needs to be addressed via something such as -> broccolijs/broccoli#479 |
Consider this snippet based on
broccoli-test-helper
:When the tree is processed, Babel will eventually be handed an options object with an
unknownOption
key and will (rightfully) raise aReferenceError
. So far, no surprises.As a result, however, the worker process where the error was raised doesn't get terminated even after the Broccoli builder has been cleaned up; the parent Node process will not terminate once work has been exhausted.
My guess is that this is caused by
workerpool
and not this package, but I'm not familiar enough with that to know whether it behaves as documented or whether it's bugged. On the other hand, it should be fairly simple to implement a workaround by catching errors inlib/worker.js
, resolving the promise with the caught error and re-throwing it inlib/parallel-api.js
→transformString
.The text was updated successfully, but these errors were encountered: