--- a/gitnexus/src/core/ingestion/workers/worker-pool.ts +++ b/gitnexus/src/core/ingestion/workers/worker-pool.ts @@ -1351,7 +1351,18 @@ ); } dispatchInFlight = true; - return dispatchGroupsInner(groups, onProgress).finally(() => { + const dispatchWithRetry = async (): Promise => { + for (let attempt = 0; ; attempt++) { + try { + return await dispatchGroupsInner(groups, onProgress); + } catch (error) { + if (!(error instanceof WorkerPoolInitializationError) || + error.crashClass !== 'transient-exhausted' || attempt >= 2) throw error; + await new Promise((resolve) => setTimeout(resolve, 10 * 2 ** attempt)); + } + } + }; + return dispatchWithRetry().finally(() => { dispatchInFlight = false; }); };