Skip to content

Nima: Filters error handling #5394

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

Closed
tomas-langer opened this issue Nov 13, 2022 · 2 comments
Closed

Nima: Filters error handling #5394

tomas-langer opened this issue Nov 13, 2022 · 2 comments
Assignees
Labels
4.x Version 4.x Níma Helidon Níma task To do
Milestone

Comments

@tomas-langer
Copy link
Member

tomas-langer commented Nov 13, 2022

Filters - error handling is probably done for each filter separately, check if this could be simplified (see stack trace in a handler).

There is a chance that this cannot be changed, but it does create quite a deep stack trace...

@tomas-langer tomas-langer added task To do 4.x Version 4.x Níma Helidon Níma labels Nov 13, 2022
@tomas-langer tomas-langer added this to the 4.0.0-M1 milestone Nov 13, 2022
@klustria klustria self-assigned this Nov 23, 2022
@klustria
Copy link
Member

Can't get to this issue yet, so I'll put this back in the queue for now for others to take if they can accommodate this.

@klustria klustria removed their assignment Jan 30, 2023
@Verdent
Copy link
Member

Verdent commented Mar 9, 2023

I took a look into this issue and from my point of view, there are 2 possible solutions:

  1. Method FilterChain#proceed() is currently selecting another Filter to be processed and overall stack trace is getting large pretty quickly. However, it can be changed to be "marker" method, which would be switching some state in FilterChain to whether it should proceed to another filter or not. That way we can have filters processed in a loop and we will completely avoid large stack trace.
    However, since there are several Filter implementations dependent on request completion (such as this one) and its state ("normal" or exception has been thrown), it would very likely require to introduce some form of callback mechanism, which would allow registering of these operations for later invocation. That could hurt overall readability and code simplicity, which is one of the main domains of the Níma.
  2. Leave it as it is right now. Overall code of the Filters will be easy to read with no callback "magic", but it brings potentially very confusingly long stack traces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x Níma Helidon Níma task To do
Projects
Archived in project
Development

No branches or pull requests

3 participants