-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: read ECONNRESET for large request body #595
Comments
Please provide a reproducible test case. Your description is vague about the request and providing more detail would really help. |
@pjfanning I created this example: pekko-test |
Thanks for sharing the reproducer, @davidgj23. I have a look. |
There's a |
Probably similar/same problem as this: mdedetrich/pekko-streams-circe#15 |
It's somewhat unlikely that this was introduced in Pekko, it's more likely a Akka 2.5 vs 2.6 issue. |
This needs to be fixed in pekko-streams-circe. We can keep it open here for the time being. |
@jrudolph Thanks for looking into this, I tried having a look at the issue in mdedetrich/pekko-streams-circe#15 but I couldn't reproduce it and the original author of the bug report couldn't create a minimal reproduction either (he only saw it in prod). Since the core code in pekko-streams-circe is ultra stable and hasn't changed, the suspicion is the regression occured due to underlying pekko/akka-streams |
In any case, using |
This is a similar issue to #460 which has also more information about the rationale. I guess it would be possible to have a more nuanced view even for pekko-http and revise the decision to have request entity cancellation mean connection closure. After all, user code can cancel or close the request/response stream (in contrast to the entity stream) if it means to do so. On the other hand, pekko-http routing code has no access to the request/response streams directly, so I wonder if there's already code relying on the current behavior (accidentally or not). |
Here's the code responsible for the behavior: Lines 140 to 141 in 03d1e95
The difference between big and small request entities is probably that for small requests the whole request is received in one big buffer so the whole processing might be playing out in one thread in one go just in the right order to still work. |
@davidgj23 if this issue is causing you problems, one option is to use The import in your routes class would become: The code in my repo doesn't stream like org.mdedetrich lib and I would generally recommend using the org.mdedetrich lib. I have tested this change with your POC. |
I am making a fixed release of pekko-streams-circe as we speak. Should be out in half an hour |
Pekko Streams Circe 1.1.0 was just released with the fix to the critical bug, release notes are here https://github.com/mdedetrich/pekko-streams-circe/releases/tag/v1.1.0 @davidgj23 Please update the version of this library if you happen to be using it |
@mdedetrich it worked after updating to 1.1.0! |
Currently, on my project, we decided to migrate from Akka to Pekko, but we're getting a strange error in one of our endpoints that doesn't happen when using Akka. The particularity of this endpoint is that its request has a field with a very long string which makes the request size 592432 bytes.
When calling the endpoint via CURL or Postman we got:
Error: read ECONNRESET
immediately, but the microservice processed the request successfully behind the scenes. Moreover, Pekko logs this error to the console:[service-pekko.actor.default-dispatcher-14] [org.apache.pekko.actor.ActorSystemImpl(service)] Request timeout encountered for request [POST /my-endpoint-url Default(592432 bytes)]
. It is worth mentioning that it works fine when using a shorter string to make the request lighter.We have tried different settings configurations like the max-content-length but it's been worthless. Also, as I mentioned before, this doesn't happen in Akka, and it happens in all Pekko versions.
Thanks in advance for your support.
The text was updated successfully, but these errors were encountered: