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

node-sass threadpool issue seems to still be there #147

Closed
adjavaherian opened this issue Aug 14, 2015 · 33 comments
Closed

node-sass threadpool issue seems to still be there #147

adjavaherian opened this issue Aug 14, 2015 · 33 comments

Comments

@adjavaherian
Copy link

I've just pulled @latest from sass-loader and node-sass, and I'm still seeing the processor peg at 100% as noted in #100 . Should I be using a different branch as a workaround? Thanks.

@jhnns
Copy link
Member

jhnns commented Aug 16, 2015

Mhmm the latest should be fine. Can anyone confirm this?

@adjavaherian
Copy link
Author

I think I've been able to reproduce it on this branch. https://github.com/adjavaherian/sass-lifter-loader/tree/node-sass-threadpool-issue If you npm start the branch in the current state, the process ties up and just hangs, but if you go to index.js and change the threadpool size to 4, process.env.UV_THREADPOOL_SIZE = 4; it will compile. Conversely, if you leave the threadpool size at 5 and remove @import "./base"; from example/scss/Frontpage.scss and YetAnother.scss (there are 4 imports total), the thread will hang.

It's tricky and very well could be a something to do with the way I'm creating new webpack instances from within a webpack loader.

@jorrit
Copy link
Contributor

jorrit commented Sep 3, 2015

It seems you're running webpack from within webpack. Probably some part of that causes yet another node fs-thread to block. Maybe the maximum parallellism of sass-loader should be configurable, so you can set it at UV_THREADPOOL_SIZE - 2 instead of UV_THREADPOOL_SIZE - 1.

@jcreamer898
Copy link

So I had to do process.env.UV_THREADPOOL_SIZE = 20; to get things working.

Is that the permanent fix? Still feels more like a workaround.

@jhnns
Copy link
Member

jhnns commented Oct 5, 2015

@jcreamer898 you should not need to adjust process.env.UV_THREADPOOL_SIZE. The sass-loader is queuing its tasks so that node-sass is not blocking all threads (until node-sass has resolved this).

@jcreamer898
Copy link

Ok, I'll update to the latest and see if I can run it now without it. Thanks!

@jhnns
Copy link
Member

jhnns commented Oct 23, 2015

Anyone still having problems?

@jhnns
Copy link
Member

jhnns commented Oct 25, 2015

Could you guys check if the branch fix/threadpool-issue fixes this problem while using the default process.env.UV_THREADPOOL_SIZE?

@jcreamer898
Copy link

Yeah, I'll have a look.

@jcreamer898
Copy link

@jhnns I still saw the issue in that branch unfortunately. The build I'm dealing with is quite large, so I'm not surprised. It hung at ~68% for me and just got stuck.

@jcreamer898
Copy link

@jcreamer898
Copy link

Ha, I realized in my package.json I was on 2.0.1. Bumped to 3.1.1, removed the env thing, and it worked ok.

@jhnns
Copy link
Member

jhnns commented Oct 26, 2015

That's nice 👍

Could anyone reading this issue also check out the branch? I would like to pull it on the master, but I don't have a test setup that demonstrates the problem.

@adjavaherian
Copy link
Author

I dont seem to have this problem anymore and I'm pretty sure we're using the master branch, so not sure what happened exactly. Hopefully this doesnt cause more confusion. :) Lemme double check in a bit.

Sent from my iPony

On Oct 26, 2015, at 9:46 AM, Johannes Ewald [email protected] wrote:

That's nice

Could anyone reading this issue also check out the branch? I would like to pull it on the master, but I don't have a test setup that demonstrates the problem.


Reply to this email directly or view it on GitHub.

@adjavaherian
Copy link
Author

Ya, I've been using 2.0.1 for a while now and not had any issues with threadpool. In fact, I don't even set the UV_THREADPOOL anymore and it seems to just work. I just tried npm installing the fix branch and it looks like there's a problem with its package.json?

//package.json
"sass-loader": "git://github.com/jtangelder/sass-loader#fix/threadpool-issue",
npm ls sass-loader
web@0.0.0 /home/adjavaherian/Desktop/web-off-master
└── sass-loader@3.1.0  invalid (git://github.com/jtangelder/sass-loader.git#d415f3fe1c8ad5e4c507fefa9f3734b4766d9d8f)

@jhnns
Copy link
Member

jhnns commented Oct 27, 2015

Yep, I've messed up this release by forgetting to move object-assign from devDependencies to dependencies. Just to test it you need to install object-assign manually.

Thx for trying it out 👍

@adjavaherian
Copy link
Author

I tried again with object-assign in my node_modules and noticed that my client config (which uses sass-loader) didn't even build. no errors, but no output either. hmm.

@bensampaio
Copy link

I am having this same problem. Any progress on this?

@alexander-akait
Copy link
Member

@bensampaio @adjavaherian Is there a problem so far?

@bensampaio
Copy link

I just tried to remove process.env.UV_THREADPOOL_SIZE = 100; and it worked. So it's safe to assume it's fixed?

@alexander-akait
Copy link
Member

@bensampaio where your can have process.env.UV_THREADPOOL_SIZE and why 100? 😄

@adjavaherian
Copy link
Author

this is resolved in v2.x and higher, right?

@alexander-akait
Copy link
Member

@adjavaherian now v6.0.3 sass-loader 😄

@alexander-akait
Copy link
Member

Closing due to inactivity. Please test with latest version and feel free to reopen if still regressions. Thanks!

@myme
Copy link

myme commented Aug 30, 2017

I'm experiencing this right now with [email protected] and [email protected]. Setting process.env.UV_THREADPOOL_SIZE = 25 in our webpack.config.js does consistently resolve the issue. Not sure what additional information I can provide if anybody wants to look further into this?

@thenanyu
Copy link

I'm also experiencing this with latest versions of node-sass and sass-loader, also working around by setting threadpool to 100

@casimcdaniels
Copy link

casimcdaniels commented Jan 31, 2018

Experience this issue in [email protected] and [email protected]. Trying to import a common variable file from multiple places inside a VueJS application. As @myme mentioned, setting UV_THREADPOOL_SIZE "fixes" the issue.

@evilebottnawi Can we reopen? The above workaround feels like a hack.

@alexander-akait
Copy link
Member

@casimcdaniels can you create minimum reproducible test repo and describe what is problem?

@jhnns
Copy link
Member

jhnns commented Apr 13, 2018

The issue is still there, I guess, since sass/node-sass#857 hasn't been closed.

@jhnns
Copy link
Member

jhnns commented Jul 11, 2018

I'm reopening this since it's still an issue for us

@jhnns jhnns reopened this Jul 11, 2018
@alexander-akait
Copy link
Member

@jhnns any ideas ho we can fix it?

@alexander-akait
Copy link
Member

/cc @bensampaio can you provide minimum reproducible test repo there you have problem.

Also if somebody have problem, feel free to feedback and try to provide minimum reproducible test repo, thanks

@alexander-akait
Copy link
Member

Closing due to inactivity. Please test with latest version and feel free to reopen if still regressions. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants