Closed datvong-wm closed 4 years ago
It's an override and it is your responsibility to clean things up since the plugin doesn't know what you are doing with the streams.
For anyone getting this issue. Fix is to close res().
onResponse: (err, res, req, h) => {
res.destroy();
return h.response({ok:true});
}
Using Hapi@17.8.4, h2o2@8.1.2. Create a simple proxy below, using onResponse.
When I hit my /test route, it keeps the proxy connects alive. When I look at the open file handles, it shows the connections in CLOSE_WAIT state.
And looking at the memory profiler, the memory used by the process balloons with every request.