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
ensure builder.cleanup()
waits on pending work
#393
Conversation
@oligriffiths this is likely the solution to the problem we spoke about on Wednesday. I finally had some time to debug it... |
Looks sane. Fix tests and we’re good I think. |
@oligriffiths |
fcd089c
to
ad63631
Compare
Although this is green, I haven't been able to fix the OOM issue (or add a test here that demonstrates it) So we should hold-off until i, or someone else, has a chance to look into that. |
@stefanpenner got a repo to demo the OOM? |
Ok so I reproduced the issue: (
Note the During cleaning, heimdall is being messed with as it is being started/stopped in the wrong order. What happens is a node starts being build, and So for now, I've added a
So the same |
So, I added some debug statements to 'use strict';
const Plugin = require('broccoli-plugin');
class Sleep extends Plugin {
build() {
return new Promise(resolve => {
console.log('Going to sleep');
setTimeout(() => {
console.log('Waking up');
resolve();
}, 2000);
});
}
}
module.exports = function(defaults) {
return new Sleep([
new Sleep([], { name: 'Sleep 1' })
], { name: 'Sleep 2' });
};
CMD+C was initiated after the first |
@oligriffiths ya, looks like something else is fishy... |
@stefanpenner yeah so broccoli-builder did call However Broccoli 2 does not, and if you do call cancel, you get an exception due to https://github.com/broccolijs/broccoli/blob/master/lib/builder.js#L109 and https://github.com/broccolijs/broccoli/blob/master/lib/builder.js#L119 I don't know what the intention behind those 2 lines is, can you shed some light? Seems like we need to do some refactoring. Imo, the flow should be
|
8fbd617
to
0d216cb
Compare
@oligriffiths I've fixed it |
0d216cb
to
37b283b
Compare
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 don't know if this is enough.
Should we not be addressing the startNode/endNode issue. See comment.
c21f52a
to
1728a72
Compare
@oligriffiths updated, mind re-reviewing? |
1728a72
to
bc62b3a
Compare
@stefanpenner something is still off. Trying with a new ember install, hitting CMD+C after
|
@oligriffiths ya we explicitly fail the build, as the build was not successful so the "BUILD CANCELLED" is expected. That being said, i cannot replicate the |
Adding a log to
|
@oligriffiths we should likely make |
@oligriffiths are you sure the heimdall warning is from broccoli, and not something in ember-cli? |
bc62b3a
to
f59471d
Compare
kill logging: heimdalljs/heimdalljs@baac3fe
|
released as v2.2.0 🎉 |
👏 |
Prior to this, if cleanup was invoked while the build was cancelling, it would begin to do cleanup prior to the current step completing. Which would typically result in "missing directory" or "missing file" errors, which would then result in the build crashing and not completing it cleanup rather then exiting cleanly.