Skip to content
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
Closed

DefaultExceptionHandler should discard Entity #2084

jlprat opened this issue Jun 20, 2018 · 2 comments
Labels
0 - new Ticket is unclear on it's purpose or if it is valid or not discuss Tickets that need some discussion before proceeding
Milestone

Comments

@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?

@jlprat jlprat added 0 - new Ticket is unclear on it's purpose or if it is valid or not discuss Tickets that need some discussion before proceeding labels Jun 20, 2018
@raboof
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
Copy link
Member Author

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
Refs: akka#2084
Discards entity on `DefaultExceptionHandler`
Adds tests to check entity is consumed on exceptions
Fixes a typo in tests
@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
Labels
0 - new Ticket is unclear on it's purpose or if it is valid or not discuss Tickets that need some discussion before proceeding
Projects
None yet
Development

No branches or pull requests

3 participants