pool.terminate hangs when "Timeout: Did not receive an init message from worker" first
未關閉
- 主要語言
- TypeScript
- 星號
- 3.5k
- 分支
- 173
- PR 合併指標
- 30 天內沒有已合併 PR
描述
I have some code like:
```
let err;
try {
await pool.settled();
} catch (_err) {
err = _err;
} finally {
await pool.terminate(!!err);
}
```
It works when there are no errors, and when there is an "expected" error in one of the threads, but when the error is "Timeout: Did not receive an init message from worker ...", calling terminate hangs. I have the workaround:
```
if (!err?.message?.startsWith('Timeout: Did not receive an init message from worker')) {
await pool.terminate(!!err);
}
```
which works, but it seems like an early exit inside terminate would be appropriate for a case like this. Thoughts?
貢獻指南
這個儲存庫沒有索引到貢獻指南
評估
這個 Issue 還沒有評估資料。