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

DefaultExceptionHandler should discard Entity #2084

Closed
jlprat opened this Issue Jun 20, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@jlprat
Copy link
Member

jlprat commented Jun 20, 2018

After #38 has been closed, we have now the situation where the DefaultRejectionHandler discards the entity but the DefaultExceptionHandler does not.

In my opinion, it should behave the same way, discarding the entity.

What do you think?

@raboof

This comment has been minimized.

Copy link
Member

raboof commented Jun 20, 2018

That seems sensible to me. One consideration here is that in the ExceptionHandler, it seems the chance is much higher that the exception occurs when the route has already consumed the entity, or (worse) when it has partially consumed the entity. Do we have a way to deal with those cases?

@jlprat

This comment has been minimized.

Copy link
Member

jlprat commented Jun 20, 2018

Yes, I was also thinking about this, that exceptions are more likely to occur when the entity is (half) consumed. But I guess discarding the entity always works, which problems do you see with discarding a partly consumed entity?

jlprat added a commit to jlprat/akka-http that referenced this issue Sep 13, 2018

Discard Entity on Default Exception Handler akka#2084
Refs: akka#2084
Discards entity on `DefaultExceptionHandler`
Adds tests to check entity is consumed on exceptions
Fixes a typo in tests

@jrudolph jrudolph closed this in 80d7e5b Sep 26, 2018

@jrudolph jrudolph added this to the 10.1.6 milestone Sep 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment