Erdnase
Erdnase

Reputation: 790

Multipart Request - FilePart Missing (Based on Network & Time taken)

I am submitting a multi part REST API request to a Tomcat server running on a container in AWS. The request has only one part in it, which is an unencrypted excel file. I am having a servlet Filter implemented in the backend. In the filter, I am having the code

Collection<Part> parts = request.getParts();
    if(parts.size()==0)
        System.out.println("No parts in request");
    else
        System.out.println("Parts detected in request");

I am observing the following behavior only when connection is from a public network.

  1. Whenever the file upload api request is submitted, file is getting uploaded for 2 minutes. Once 2 minutes timeout is completed, no error is received for the upload but the HTTP request is forwarded to the back-end controller without the file.
  2. If the file size is smaller and the transfer gets completed in 2 minutes, request received at back-end includes the file.
  3. This occurs only when my upload is from a public network. When the upload is from Internal network, even file transfer waits for more than 5 minutes and gets completed by that time.
  4. I am not having any errors in front end, my front-end code is confident that it has sent the file to back-end completely even when the file is not properly transferred due to the above issue.

I have checked with the Network team and there is no firewall restrictions which could cause this behavior.

What can cause this kind of a behaviour? Could there be any setting in AWS alb, which can silently restrict the maximum time a request can upload a file?

Upvotes: 0

Views: 17

Answers (0)

Related Questions