SIGINT seems to be ignored by server. HTTP server exposes .kill() and .close() but default listener for SIGINT seems to be missing
Package version
Adonis packages
"@adonisjs/assembler": "^1.3.4",
"@adonisjs/ace": "^6.8.4",
"@adonisjs/core": "^5.0.0-preview.4",
"@adonisjs/fold": "^6.3.4",
Node.js and npm version
NodeJS: 13.9.0
NPM: 6.13.7
Sample Code (to reproduce the issue)
When building container and setting start command as CMD [ "node", "./build/server.js" ]
Container does not die gracefully with SIGINT since SIGINT is sent to process, which just ignores it
Fix is to add process.on('SIGINT') yourself to some part of application, server.ts for example
// server.ts (original)
new Ignitor(__dirname)
.httpServer()
.start()
.catch(console.error)
Workaround is to chop it into multiple pieces and adding SIGINT listener
// server.ts (workaround)
const server = new Ignitor(__dirname)
.httpServer()
server.start()
.catch(console.error)
// Without it process won't die in container
process.on('SIGINT', () => {
server.kill(10)
})
BONUS (a sample repo to reproduce the issue)
https://gitlab.com/McSneaky/youtube-downloader
SIGINTseems to be ignored by server. HTTP server exposes.kill()and.close()but default listener for SIGINT seems to be missingPackage version
Adonis packages
Node.js and npm version
NodeJS: 13.9.0
NPM: 6.13.7
Sample Code (to reproduce the issue)
When building container and setting start command as
CMD [ "node", "./build/server.js" ]Container does not die gracefully with
SIGINTsinceSIGINTis sent to process, which just ignores itFix is to add
process.on('SIGINT')yourself to some part of application,server.tsfor exampleWorkaround is to chop it into multiple pieces and adding
SIGINTlistenerBONUS (a sample repo to reproduce the issue)
https://gitlab.com/McSneaky/youtube-downloader