Skip to content

Commit

Permalink
Fix shutdown ENOTCONN error
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Aug 10, 2018
1 parent 06270f6 commit 1bb1f33
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion autocannon.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ function start (argv) {
// `nitm` catches the SIGINT so we write it to a file descriptor
// instead of doing proc.kill()
proc.stdio[3].write('SIGINT')
proc.stdio[3].end()
// Not closing the stream 3 here, calling .end() will throw an error:
// https://github.com/nodejs/node/issues/13542
// The child will exit cleanly and close the pipe then.
})
})
} else {
Expand Down

0 comments on commit 1bb1f33

Please sign in to comment.