-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
SimpleAsyncTaskScheduler should ignore scheduled exceptions after shutdown (not termination) #33334
Comments
Thanks for the detailed analysis @genuss. I think what you propose for |
Should I create a PR for the change? |
@genuss if you have something ready, please go ahead :) |
Sounds sensible to use As for |
Superseded by PR #33336. |
Basically my issue is described in #32381. The implemented solution works in almost all cases, but I still experience
TaskRejectedException
logged as errors in the following case:ContextClosedEvent
is already published;SimpleAsyncTaskScheduler#scheduledExecutor
is shut down, but didn't yet terminated;I couldn't create a minimal reproducible example, but I'd like to show an excerpt from logs.
I suppose, the reason can be explained as follows.
SimpleAsyncTaskScheduler#onApplicationEvent
callsExecutorService#shutdown
thus switching its running state toSHUTDOWN
.SimpleAsyncTaskScheduler#shutdownAwareErrorHandler
checks forExecutorService#isTerminated
which only returnstrue
if an executor is inTERMINATED
running state.The proposed solution: use
ExecutorService#isShutdown
instead.I hesitated to create a PR as I also found a call to
isTerminated
toExecutorLifecycleDelegate
and not sure if it should be changed too.The text was updated successfully, but these errors were encountered: