-
Notifications
You must be signed in to change notification settings - Fork 0
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
Bugfix: Catch RejectedExecutionException and skip validation #13
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Do you have a test for this?
@dominik-riha Now we do 😄 |
try { | ||
threadPoolExecutor.execute(command); | ||
} catch (RejectedExecutionException ignored) { | ||
// ignored |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to monitor this? It could point to a configuration issue (thread pool too small for the amount of requests handled). If you are not monitoring, you could simply set up the In ThreadPoolExecutor.DiscardPolicy
handler instead, see https://stackoverflow.com/questions/8183205/what-could-be-the-cause-of-rejectedexecutionexception
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now not planning to monitor. Maybe later? Added DiscardPolicy
now. Still leaving RejectedExecutionException
just for safety :)
ThreadPoolExecutor.execute
can throw RejectedExecutionException. If it does, we just want to ignore it and skip validation for that request. This way we guarantee the request going through in those cases.