You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How often does it reproduce? Is there a required condition?
It can be reproduced all the time. The issue is, I have created the http server using http.createServer() and had set the server.timeout = X; expecting the server to close the connection when the request is processed for more than "X" milliseconds, but it's not working as expected. The request is processed and responded even long after time.
If my understanding is incorrect, could you guide me something similar to max_execution_time in PHP ?
What I basically want is, I want my node http server to return 504 error when it's not able to respond within "X" milliseconds.
What is the expected behavior?
Returning 504 timeout error
What do you see instead?
200 success response
Additional information
The text was updated successfully, but these errors were encountered:
Could you add basic code that shows how you start processing request? Because for now i would guess that you start processing on main thread and keep it busy for a long time, so timeout has no chance of being triggered.
Start long-running processes, that do not allow main event loop to continue, in a separate worker or a child process.
You can spawn a single (or a few) "workers", a "job queue" process (or just use one of the databases best for such tasks), and add jobs to queue. How you resolve that is up to you (or many tutorials/guides available elsewhere) - i don't think node.js issue is a place for that.
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
It can be reproduced all the time. The issue is, I have created the http server using
http.createServer()
and had set theserver.timeout = X;
expecting the server to close the connection when the request is processed for more than "X" milliseconds, but it's not working as expected. The request is processed and responded even long after time.If my understanding is incorrect, could you guide me something similar to
max_execution_time
in PHP ?What I basically want is, I want my node http server to return 504 error when it's not able to respond within "X" milliseconds.
What is the expected behavior?
Returning 504 timeout error
What do you see instead?
200 success response
Additional information
The text was updated successfully, but these errors were encountered: