-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Describe the bug
When using the Lambda event server and requesting data from an endpoint, the HTTP response gets stuck after sending about 10KB for large responses.
Expected behavior
10 KB should be not issue. AWS Lambda supports up to 10 MB of response size.
Actual behavior
The response to the request never gets completed
How to Reproduce?
Reproducer: lambda-gets-stuck.zip
or
- Go to https://code.quarkus.io/ and add
AWS Lambda HTTPandREST Jackson. - Replace the content of the
hello()method inGreetingResourcewithList<String> greetings = new ArrayList<>(); for (int i = 0; i < 580; i++) { greetings.add("Hello World " + i); } return greetings;
- Start the dev server and run
curl localhost:8080/hello
It should just get stuck and never finish, although a lot of the response is displayed.
Output of uname -a or ver
Linux clemens-WAPP-Laptop 6.8.0-45-generic #45~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Sep 11 15:25:05 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Output of java -version
openjdk version "21.0.2" 2024-01-16 LTS OpenJDK Runtime Environment Corretto-21.0.2.14.1 (build 21.0.2+14-LTS) OpenJDK 64-Bit Server VM Corretto-21.0.2.14.1 (build 21.0.2+14-LTS, mixed mode, sharing)
Quarkus version or git rev
3.16.3
Build tool (ie. output of mvnw --version or gradlew --version)
wrapperVersion=3.3.2
Additional information
It seems to me that the following factors need to come together to provoke this behavior:
- Running the dev server: When deploying to AWS, it seems to work
- Large response size:. Interestingly, reducing
580to570will get it stuck earlier, but with200, it works for me. Since there might be timing issues at play, this could vary and you might need to increase 580 to a sufficiently high number. - JSON serialization: Adding
@Produces(MediaType.TEXT_PLAIN)causes the bug to disappear, even when using much higher upper bounds in the for loop such as10_000. - Lambda HTTP Dependency: Commenting out the
quarkus-amazon-lambda-httpdependency in thepom.xmlwill also make the bug disappear.