Commit 6af3a28
committed
fix(core): avoid double-settle in async finding handling
When a before-hook throws inside an async function body, the async
function returns a rejected Promise AND the finding is stored
synchronously. Previously, both paths would resolve the C++ promise
and deferred (via the synchronous throw's catch block and the
.then() rejection handler's microtask), which is undefined behavior
that can hang forked child processes.
Check clearFirstFinding() before attaching .then() handlers. If a
synchronous finding exists, suppress the rejected Promise and handle
the finding exclusively through the synchronous path.1 parent c718e7a commit 6af3a28
1 file changed
Lines changed: 31 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | 372 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
386 | 404 | | |
387 | 405 | | |
388 | 406 | | |
| |||
0 commit comments