Skip to content
This repository was archived by the owner on Dec 5, 2019. It is now read-only.

[v1.0.0-beta.2 (Windows)] Stuck in chunk assets optimization when parallelization is enabled (options.parallel) #118

Closed
jinker opened this issue Sep 1, 2017 · 23 comments

Comments

@jinker
Copy link

jinker commented Sep 1, 2017

webpack 3.5
windows 7

@jinker jinker changed the title Stuck in chunk assets optimization when parallel set true in windows [v1.0.0-beta.2]Stuck in chunk assets optimization when parallel set true in windows Sep 1, 2017
@michael-ciniawsky michael-ciniawsky changed the title [v1.0.0-beta.2]Stuck in chunk assets optimization when parallel set true in windows [v1.0.0-beta.2] Stuck in chunk assets optimization when parallel set true in windows Sep 1, 2017
@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Sep 1, 2017

Please provide more info on your current setup webpack.config.js, package.json && Error Logs etc

@kumarharsh
Copy link

kumarharsh commented Sep 13, 2017

+1 it's not working under Windows 10 CU - tested in two different systems with different processors and SSD/HDDs. The webpack process takes about 1GB memory but 0% CPU utilization.

This is the uglify config:

          uglifyOptions: {
            compress: { warnings: false },
          },
          sourceMap: true,
          parallel: {
            cache: path.join(CACHE_DIR, 'uglifyjs'),
            workers: true,
          },

Turning parallel off via parallel: false lets me build it. Setting parellel:true and workers: false also makes it work. Could it be an issue with node-worker-farm?

@alexander-akait
Copy link
Member

@kumarharsh @jinker known issue, should be fixed in #108. Because parallel (workers) don't use as expected.

@WillooWisp
Copy link

I experience similar issues with parallel enabled.

@alexander-akait
Copy link
Member

@WillooWisp #118 (comment)

@kumarharsh
Copy link

@evilebottnawi great job on the PR. Quick question: does it address parallelization issue in Windows where the webpack process just hangs?

@alexander-akait
Copy link
Member

@kumarharsh this PR should fix this, but need tests, can you test this PR on windows?

@kumarharsh
Copy link

kumarharsh commented Sep 20, 2017

Unfortunately, seems like it gets stuck at the same place. The children spawned by worker-farm seem to not respond - no CPU is being used, and my build process is stuck at the uglify step. The Memory value also is static for a long time.

image


Edit

So the memory usage for the worker-farm spawns did come down, but the uglify process still hasn't completed.

image


Update

So, after terminating the process, I got the error at the end, though I have no idea where it came from.

Assertion failed: handle->pending_signum == 0, file src\win\signal.c, line 272

@alexander-akait
Copy link
Member

@kumarharsh can you create minimum reproducible test repo?

@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Oct 21, 2017

We definitely need a repro repo here, there is a bug somewhere either in the plugin or worker-farm on windows (7)

@alexander-akait
Copy link
Member

@jinker friendly ping, can you try latest version?

@linh1987
Copy link

linh1987 commented Oct 27, 2017

just to chime in, We encountered the same issue with our CI environment:
Windows Server 2012 R2 / Teamcity
Node 6.4.0 with included NPM.

Works fine in my local environment:
Windows 10 CU.
Node 6.11.1 with included NPM.

I will try to revert to Node 6.4.0 to see if it happens
edit: not happening on 6.4.0 locally, definitely something else..

@jinker
Copy link
Author

jinker commented Oct 29, 2017

OK, I will try later.

@vkrol
Copy link

vkrol commented Oct 29, 2017

We have same problem with the following configuration:
Windows 10 1703
webpack 3.8.1
[email protected]

@michael-ciniawsky michael-ciniawsky modified the milestones: 2.0.0, 1.0.2 Oct 29, 2017
@alexander-akait
Copy link
Member

@jinker @vkrol @jinker can you create minimum reproducible test repo?

@brentwilton
Copy link
Contributor

We have been encountering the same issue on Windows 10.

With parallel turned on the dist/uglify/worker.js will successfully minify the file and process.send() the reply back to the parent, but the parent never receives the message from the forked process.

forked.child.on('message', this.receive.bind(this)) is never invoked in worker-farm/lib/farm.js even though the message is sent from the child fork.

It appears as if the IPC is not working between the child and parent processes. This may be due to Windows not handling large amounts of IPC traffic correctly.

However if I add the maxConcurrentCallsPerWorker: 1 option when creating the worker farm in dist/uglify/index.js then it appears to complete successfully.

this.workers = (0, _workerFarm2.default)({
  maxConcurrentWorkers: this.maxConcurrentWorkers,
  maxConcurrentCallsPerWorker: 1
}, workerFile);

Adding maxConcurrentCallsPerWorker: 1 prevents the parent from sending multiple requests via IPC before the child has responded.

If you are experiencing this issue can you try adding maxConcurrentCallsPerWorker: 1 to your ./node_modules/uglifyjs-webpack-plugin/dist/uglify/index.js and see if it fixes the issue for you ?

Windows 10 1511
webpack: 3.8.1
uglifyjs-webpack-plugin: 1.1.0
nodejs 8.9.0

@michael-ciniawsky
Copy link
Member

@brentwilton Feel free to open a PR with this change for further discussion

@michael-ciniawsky michael-ciniawsky changed the title [v1.0.0-beta.2] Stuck in chunk assets optimization when parallel set true in windows [v1.0.0-beta.2 (Windows)] Stuck in chunk assets optimization when parallelization is enabled (options.parallel) Nov 22, 2017
@michael-ciniawsky
Copy link
Member

Released in v1.1.0 please test

@michael-ciniawsky michael-ciniawsky removed this from the 1.1.1 milestone Nov 23, 2017
@wclr
Copy link

wclr commented Dec 8, 2017

Using 1.1.2 I have this issue in windows 10 (WSL). Have to use parallel: fase

@StalkAlex
Copy link

In last version everything works the same means not working with parallel option, so this issue should be reopened at least. I'm using it on BashOnWindows Windows 10, but everything works if I run it as normal windows process.

@StalkAlex
Copy link

StalkAlex commented Mar 3, 2018

This check should be improved I think. As it will fail in Windows's Ubuntu, but it's still Windows.

Just checked with maxConcurrentCallsPerWorker: 1 on BashOnWindows and it worked.

@lednhatkhanh
Copy link

lednhatkhanh commented Apr 25, 2018

This should be reopened, still facing this with webpack 4 and version 1.2.5 @

@alexander-akait
Copy link
Member

@lednhatkhanh no, original issue was solved, feel free to open new issue with minimum reproducible test repo. Thanks!

@webpack-contrib webpack-contrib locked as resolved and limited conversation to collaborators Apr 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests