Say you have an endpoint that hangs and doesn't return anything to the client, eg:
var carbon = require('carbon-io')
var o = carbon.atom.o(module).main
var __ = carbon.fibers.__(module)
__(function() {
module.exports = o({
_type: carbon.carbond.Service,
port: 8888,
endpoints: {
hello: o({
_type: carbon.carbond.Endpoint,
get: function(req) {
console.log("Don't return anything")
}
})
}
})
});
Now, if I make a call to /hello, when I try to Ctrl-C out of the process on the shell, it takes much longer than expected to kill the process. It ouputs these lines:
[Fri Jun 23 2017 10:28:46 GMT-0700 (PDT)] INFO: Service stopping...
[Fri Jun 23 2017 10:28:46 GMT-0700 (PDT)] INFO: Service stopping HTTP server
At this point it hangs. Then after over a minute it continues:
[Fri Jun 23 2017 10:30:41 GMT-0700 (PDT)] INFO: Service closing database connections
[Fri Jun 23 2017 10:30:41 GMT-0700 (PDT)] INFO: Service stopped
[Fri Jun 23 2017 10:30:41 GMT-0700 (PDT)] INFO: bye
Expected behavior: kill the process quickly on SIGINT
Say you have an endpoint that hangs and doesn't return anything to the client, eg:
Now, if I make a call to
/hello
, when I try toCtrl-C
out of the process on the shell, it takes much longer than expected to kill the process. It ouputs these lines:At this point it hangs. Then after over a minute it continues:
Expected behavior: kill the process quickly on SIGINT