-
Notifications
You must be signed in to change notification settings - Fork 137
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
Allow thread-loader
configuration
#795
Allow thread-loader
configuration
#795
Conversation
Currently `thread-loader` is not configurable, meaning that in some CI environments where the OS reports a very large number of CPUs, `thread-loader` will create a very large worker pool. The only configuration that is currently available is setting `JOBS=1`, but the pool warmup call doesn't check `JOBS`, so always spawns the full number of workers. So this commit: * Skips warming the worker pool if `JOBS=1` and we know we won't be using `thread-loader` * Adds a `thread-loader` configuration object to the options interface that allows applications to pass their own `thread-loader` configuration, or `false` to disable the use of `thread-loader` entirely.
The context around this (for me) is that my embroider builds are failing in CI because the containers have 4GB of RAM, and that gets used up quickly spawning 35 or however many workers (which is unavoidable currently because of the worker pool warming). Just the change for But if there are any concerns about the configuration/options change, I'd be happy to split the change where |
@@ -76,6 +66,7 @@ const Webpack: Packager<Options> = class Webpack implements PackagerInstance { | |||
private extraConfig: Configuration | undefined; | |||
private passthroughCache: Map<string, Stats> = new Map(); | |||
private publicAssetURL: string | undefined; | |||
private extraThreadLoaderOptions: object | false | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe replace object with ThreadLoaderOptions Type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find types for thread-loader
anywhere, and wasn't sure we'd want to sign up for maintaining our own type. We certainly could though...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I couldn't find either, nvm..
Thanks for digging into this, this looks great. |
thread-loader
configuration
Currently
thread-loader
is not configurable, meaning that in some CI environments where the OS reports a very large number of CPUs,thread-loader
will create a very large worker pool.The only configuration that is currently available is setting
JOBS=1
, but the pool warmup call doesn't checkJOBS
, so always spawns the full number of workers.So this commit:
JOBS=1
and we know we won't be usingthread-loader
thread-loader
configuration object to the options interface that allows applications to pass their ownthread-loader
configuration, orfalse
to disable the use ofthread-loader
entirely.