Closed uasan closed 1 year ago
Provide new method in uws.js app instance, something like this App.prototype.closeAllConnections()
Are you aware there is app.close()
method since like 6 months ago
https://github.com/uNetworking/uWebSockets/releases/tag/v20.34.0
Easy shutdown with App.close()
Calling this new function will:
- Close and invalidate all open listen sockets.
- Force close all open connections (both HTTP and WebSockets), calling their respective callbacks as needed (.onAborted, .close, .subscription).
This call can be used to gracefully close and release an App that needs maintenance.
Are you aware there is app.close() method since like 6 months ago
Did not know, all this time they were using an older version. Thank you very much, this completely solves my problem! I close the ticket
Before closing the worker, we call
But this is not enough, you also need to close all open connections, when you close the connection in which the completed response was, there will be this error:
When the worker terminates, the exit event handlers are not called, so your code that should clear all open resources is not called, as a result we get a fatal error from the libuv
Two fix options:
App.prototype.closeAllConnections()