You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stop starting new files after a panic with --halt #789
With --halt, the engine rejects with a panic on the first error, but the files that are already in work, and the ones after them, are still changed.
The workers in engine() (src/engine.ts:160-167) each take the next file until there are none left. When one worker throws a panic, Promise.all rejects, but nothing stops the other workers. They go on taking files from next.
Run the engine with 40 files, voidAsync: false and halt: true, where the first file can not be read:
The CLI does not show this, because it ends the process right after the panic. But it breaks "the engine throws a panic when the run can not go on" from devguide.md, and it hits:
Anyone who uses the engine as a library.
rr() in test/helper.js, which puts the spies on stdout and stderr back while the workers still print.
printDone(), which runs before the late prints, so --nl can be wrong.
Change
Stop the workers once a panic is thrown: a flag that the worker loop checks before it takes the next file.
Add an engine test with voidAsync: false and --halt that checks that no file after the error is changed.
Good to know
A file that is already being read or written when the panic comes will still finish. That is fine: the point of --halt is that no new file is started.
Activity
Await async work before exiting to close #789 and #813 (#811)