Commit 779bed7
fix: destroy V8 session on process kill to prevent dangling IPC socket
When a spawned process was killed, the V8 session's execute() promise
remained pending with its handler registered in sessionHandlers, keeping
the IPC socket ref'd and preventing Node.js from exiting.
Two fixes:
1. Track the current V8 session in NodeExecutionDriver and destroy it
during terminate()/dispose() to unregister the session handler and
unref the IPC socket.
2. Close streaming stdin source on process kill so pending reads resolve
instead of hanging forever.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent a28840c commit 779bed7
3 files changed
Lines changed: 76 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
772 | 772 | | |
773 | 773 | | |
774 | 774 | | |
| 775 | + | |
| 776 | + | |
775 | 777 | | |
776 | 778 | | |
777 | 779 | | |
| |||
1250 | 1252 | | |
1251 | 1253 | | |
1252 | 1254 | | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
1253 | 1258 | | |
1254 | 1259 | | |
1255 | 1260 | | |
| |||
1381 | 1386 | | |
1382 | 1387 | | |
1383 | 1388 | | |
| 1389 | + | |
1384 | 1390 | | |
1385 | 1391 | | |
1386 | 1392 | | |
| |||
1389 | 1395 | | |
1390 | 1396 | | |
1391 | 1397 | | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
1392 | 1403 | | |
1393 | 1404 | | |
1394 | 1405 | | |
| |||
1398 | 1409 | | |
1399 | 1410 | | |
1400 | 1411 | | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
1401 | 1417 | | |
1402 | 1418 | | |
1403 | 1419 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
568 | 572 | | |
569 | 573 | | |
570 | 574 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
880 | 880 | | |
881 | 881 | | |
882 | 882 | | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
883 | 939 | | |
0 commit comments