tweag / inline-js

Call JavaScript from Haskell, and vice versa!
https://inline-js.netlify.app
130 stars 10 forks source link

SIGKILL myself upon unhandledRejection events #53

Closed TerrorJack closed 4 years ago

TerrorJack commented 4 years ago

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?