Our unhandledRejection handler in eval.js writes the error to stderr then rethrows it as an (uncaught) exception. It seems the node process doesn't exit when the asterius TH runner crashes, resulting in infinite blocking of ahc. Oddly even process.exit(1) won't exit node, so here we do a simple hack of suiciding the node process by sending itself a SIGKILL.
This PR isn't supposed to be merged; we should investigate the problem further: does this only occur with asterius TH runner, or all regular eval commands? How do we properly handle this kind of error in inline-js-core, rethrowing the error message in Haskell while avoiding infinite blocking?
Our
unhandledRejection
handler ineval.js
writes the error tostderr
then rethrows it as an (uncaught) exception. It seems thenode
process doesn't exit when the asterius TH runner crashes, resulting in infinite blocking ofahc
. Oddly evenprocess.exit(1)
won't exitnode
, so here we do a simple hack of suiciding thenode
process by sending itself aSIGKILL
.This PR isn't supposed to be merged; we should investigate the problem further: does this only occur with asterius TH runner, or all regular eval commands? How do we properly handle this kind of error in
inline-js-core
, rethrowing the error message in Haskell while avoiding infinite blocking?