fix(server): retire the compiler worker after build errors

A failed parallel target can leave the other target compiling. Await worker termination before the next queued request instead of reusing an isolate with unfinished build work.
This commit is contained in:
Mohamed Boudra
2026-10-26 19:41:33 +01:00
parent 4b5c52ebe6
commit d8675174eb
@@ -113,6 +113,9 @@ class PluginCompiler {
const error = reply.issues ? new ZodError(reply.issues) : reply.error;
if (reply.errors) Object.assign(error, { errors: reply.errors });
if (reply.warnings) Object.assign(error, { warnings: reply.warnings });
// Promise.all can reject while the other target is still compiling.
// Retire the isolate before another request can enter it.
this.stopWorker(worker);
reject(error);
}
};