My network setup on AWS looks like the following:
ECS Fargate services with App Mesh, Envoy Proxy and ELB.
Everything is working fine, except when a (download) request is took longer than 30 seconds. One of our service creates a zip file on request and sends a download link to the user. If the zip is small, everything is working fine, the user can download it successfully. If the zip is bigger and the download takes more than 30 seconds, it will fail.
The bug has been tracked down to App Mesh - Virtual Node Listener timeouts.
Timeouts was on default settings (empty/unset) and the 30 sec bug happened.
When Request timeout was set to a big enough number, the download was successful, but a fixed timeout, like 600s still had the chance to produce the same bug for really big files.
When Request timeout was set to 0s (expected to this will work as "unlimited"), bigger downloads was successful too, but not sure if it is a right thing to do or not.
My question is:
App mesh Listener with 0s Request timeout is a good practice or it will produce different problems what I'm not aware?
If it is a bad practice, how can I force App Mesh, to don't kill my file stream after 30 seconds?
Example response header for the file download:
HTTP/2 200 OK
date: Wed, 05 Oct 2022 09:06:45 GMT
content-type: application/octet-stream
content-length: 17325639
content-disposition: attachment; filename="a08c94a3-068e-486f-92c7-371d00984ddc.zip"
expires: Wed, 05 Oct 2022 09:07:45 GMT
cache-control: private, max-age=60
last-modified: Wed, 05 Oct 2022 07:11:28 GMT
access-control-allow-headers: Cache-Control, X-CSRF-Token, X-Requested-With
access-control-allow-origin: *
server: envoy
x-envoy-upstream-service-time: 55
X-Firefox-Spdy: h2
The following header is set by the server but removed possibly by envoy:
connection: keep-alive