andywer / andywer/threads.js

pool.terminate hangs when "Timeout: Did not receive an init message from worker" first

オープン
#461 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
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 はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。