Joystream / joystream

Joystream Monorepo
http://www.joystream.org
GNU General Public License v3.0
1.42k stars 115 forks source link

[Colossus] fix: upload aborted error #5094

Closed zeeshanakram3 closed 6 months ago

zeeshanakram3 commented 6 months ago

addresses #5081

Context

There is a server.requestTimeout configuration option in the http.Server instance (remember express is just a wrapper around nodejs native HTTP Server), from the nodejs official documentation what this option means:

Sets the timeout value in milliseconds for receiving the entire request from the client.

If the timeout expires, the server responds with status 408 without forwarding the request to the request listener and then closes the connection.

The default value for the option is 300s for node versions >=18.x, while for the previous version the default value was 0 (no timeout)

So, the uploads failing problem started to occur when we updated the Nodejs from v14 to v18.6.0 in #4778

This timeout value of 300s also validates Ignazio's investigation that Colossus aborts errors after ~5 minutes.

ignazio-bovo commented 6 months ago

The fix works in the sense that the above observed error is gone and the request time is in my case 6.4 mins > 5mins