-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Freeze of bundler since 1.5.1 #900
Comments
cc @brandon93s |
issue has also been reported in #637 |
My temporary workaround is to open class WorkerFarm extends Farm {
constructor(options) {
let opts = {
maxConcurrentWorkers: getNumWorkers(),
maxConcurrentCallsPerWorker: 5
}; (that's assuming you installed Parceljs locally, not globally) |
It'd be cool if someone on Windows could try #1105 to see if it fixes it |
@fathyb I can place it to my |
@catamphetamine Oh, sorry. Jasper has some super-powers to push directly on the main Parcel repo. You can try the PR using (if you are using
|
@fathyb Well, seems that it still hangs: |
And it's the latest code in the src folder: c:\dev\react-website-basic-example - Copy (master -> origin) (react-website-basic-example@1.0.0)
λ cat node_modules\parcel-bundler\src\workerfarm\WorkerFarm.js
const {EventEmitter} = require('events');
const os = require('os');
const fork = require('./fork');
const errorUtils = require('./errorUtils');
const PARCEL_WORKER =
parseInt(process.versions.node, 10) < 8
? require.resolve('../../lib/workerfarm/worker')
: require.resolve('../../src/workerfarm/worker');
let shared = null;
class WorkerFarm extends EventEmitter {
constructor(options, farmOptions = {}) {
super();
this.options = Object.assign(
{
maxConcurrentWorkers: WorkerFarm.getNumWorkers(),
maxConcurrentCallsPerWorker: 10,
forcedKillTime: 100,
warmWorkers: true,
useLocalWorker: true,
workerPath: PARCEL_WORKER
},
farmOptions
); I guess someone else could try it on their Windows (I have Windows 10). It still works with |
I wanted to be sure because it re-implemented the WorkerFarm. If it doesn't fixes it for you chances are it'll not fix it for anybody. Thanks for testing though, I'll try to find other solutions (but feel free to find alternative solutions). |
If the cause really is the ipc bug inside node.js there isn't much we can do except perhaps timeout the responses and kill the worker if it takes too long. However if maxConcurrentCalls works it might actually be a ram issue? Would be nice if anyone would be able to debug it in depth. My workerfarm PR isn't much different from the node-worker-farm when it comes to handling requests, mainly to keep it sort of the same as before and make sure it's sort of bugfree as node-worker-farm has been tested a lot. (It should in theory be more lightweight though) |
@DeMoorJasper The VSCode team seems to have fixed it, quoting
The fix is in microsoft/vscode#13763. We could try implementing it in the new WorkerFarm only on Windows, still better than guessing |
@fathyb Intresting, I'll try implement something similar, although I think the calls are already sequential. I'll look into it. |
Alright I've implemented a fix for this in the |
@DeMoorJasper If I understand the WorkerFarm correctly (might be wrong)
|
@DeMoorJasper I tested again and it still freezes. |
@catamphetamine After a little chat with fathyb I removed it again as it impacted performance quite a bit and I misunderstood what vscode actually did to fix this. |
@catamphetamine I pushed the slightly better fix now, as this one also slightly improves queue handling on other operating systems. |
@DeMoorJasper Oh, this one seems to be working. |
@DeMoorJasper and @catamphetamine where can I get this fix? I'm happy to test it on my windows 10 home. |
@supertopoz you can try it using PR #1105 |
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the amount of data written exceeds the size of the pipe buffer. Fixes: #1099 Fixes: nodejs/node#7657 Fixes: electron/electron#10107 Fixes: parcel-bundler/parcel#637 Fixes: parcel-bundler/parcel#900 Fixes: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: #1099 Fixes: nodejs/node#7657 Fixes: electron/electron#10107 Fixes: parcel-bundler/parcel#637 Fixes: parcel-bundler/parcel#900 Fixes: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: #1099 Fixes: nodejs/node#7657 Fixes: electron/electron#10107 Fixes: parcel-bundler/parcel#637 Fixes: parcel-bundler/parcel#900 Fixes: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: #1099 Fixes: nodejs/node#7657 Fixes: electron/electron#10107 Fixes: parcel-bundler/parcel#637 Fixes: parcel-bundler/parcel#900 Fixes: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: #1099 Fixes: nodejs/node#7657 Fixes: electron/electron#10107 Fixes: parcel-bundler/parcel#637 Fixes: parcel-bundler/parcel#900 Fixes: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: libuv#1099 Fixes: nodejs/node#7657 Fixes: electron/electron#10107 Fixes: parcel-bundler/parcel#637 Fixes: parcel-bundler/parcel#900 Fixes: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: libuv#1099 Fixes: nodejs/node#7657 Fixes: electron/electron#10107 Fixes: parcel-bundler/parcel#637 Fixes: parcel-bundler/parcel#900 Fixes: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: #1099 Fixes: nodejs/node#7657 Fixes: electron/electron#10107 Fixes: parcel-bundler/parcel#637 Fixes: parcel-bundler/parcel#900 Fixes: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: #1099 Fixes: nodejs/node#7657 Fixes: electron/electron#10107 Fixes: parcel-bundler/parcel#637 Fixes: parcel-bundler/parcel#900 Fixes: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: #1099 Fixes: nodejs/node#7657 Fixes: electron/electron#10107 Fixes: parcel-bundler/parcel#637 Fixes: parcel-bundler/parcel#900 Fixes: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: #1099 Fixes: nodejs/node#7657 Fixes: electron/electron#10107 Fixes: parcel-bundler/parcel#637 Fixes: parcel-bundler/parcel#900 Fixes: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: #1099 Fixes: nodejs/node#7657 Fixes: electron/electron#10107 Fixes: parcel-bundler/parcel#637 Fixes: parcel-bundler/parcel#900 Fixes: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: #1099 Refs: nodejs/node#7657 Refs: electron/electron#10107 Refs: parcel-bundler/parcel#637 Refs: parcel-bundler/parcel#900 Refs: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: #1099 Refs: nodejs/node#7657 Refs: electron/electron#10107 Refs: parcel-bundler/parcel#637 Refs: parcel-bundler/parcel#900 Refs: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: #1099 Refs: nodejs/node#7657 Refs: electron/electron#10107 Refs: parcel-bundler/parcel#637 Refs: parcel-bundler/parcel#900 Refs: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: #1099 Refs: nodejs/node#7657 Refs: electron/electron#10107 Refs: parcel-bundler/parcel#637 Refs: parcel-bundler/parcel#900 Refs: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: #1099 Refs: nodejs/node#7657 Refs: electron/electron#10107 Refs: parcel-bundler/parcel#637 Refs: parcel-bundler/parcel#900 Refs: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: #1099 Refs: nodejs/node#7657 Refs: electron/electron#10107 Refs: parcel-bundler/parcel#637 Refs: parcel-bundler/parcel#900 Refs: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: #1099 Refs: nodejs/node#7657 Refs: electron/electron#10107 Refs: parcel-bundler/parcel#637 Refs: parcel-bundler/parcel#900 Refs: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: #1099 Refs: nodejs/node#7657 Refs: electron/electron#10107 Refs: parcel-bundler/parcel#637 Refs: parcel-bundler/parcel#900 Refs: parcel-bundler/parcel#1137
This fixes a bug where IPC pipe communication would deadlock when both ends of the pipe are written to simultaneously, and the kernel pipe buffer has already been filled up by earlier writes. The root cause of the deadlock is that, while writes to an IPC pipe are generally asynchronous, the IPC frame header is written synchronously. So when both ends of the pipe are sending a frame header at the same time, neither will read data off the pipe, causing both header writes to block indefinitely. Additionally, this patch somewhat reduces the spaghetti level in win/pipe.c. Fixes: #1099 Refs: nodejs/node#7657 Refs: electron/electron#10107 Refs: parcel-bundler/parcel#637 Refs: parcel-bundler/parcel#900 Refs: parcel-bundler/parcel#1137 PR-URL: #1843 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
🤔 Expected Behavior
The bundler should finish on any system it runs on.
😯 Current Behavior
On specific systems, in our case a virtual Windows Server environment, the bundler stops and random files without any errors.
💁 Possible Solution
My investigation showed that it is some wierd scenario of memory issues, causing certain workers to become zombies. Therefore, these workers will never stop working and the bundler stops. It's possible to fix this issue by adjusting the "maxConcurrentCallsPerWorker" settings of the worker-farm. In our case, we reduced this value from 10 to 5 to get a stable result.
To become maximum flexible, I would suggest to make this setting available as env variable, just the like worker count, keeping the default value at 10.
🌍 Your Environment
The text was updated successfully, but these errors were encountered: