You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes you cannot throw InterruptedException, for instance when your code is part of a Runnable. In these situations, you must catch InterruptedException and restore the interrupted status by calling interrupt on the current thread
The provided backoff policies (e.g. FixedBackOffPolicy, ExponentialBackOffPolicy) throw a BackOffInterruptedException without restoring the flag.
Do you think it is possible to restore the flag before throwing the runtime exception?
I can open a PR.
It is good practice to restore the interrupted flag of the current thread when
InterruptedException
cannot be thrown.From Java Concurrency in Practice1:
The provided backoff policies (e.g.
FixedBackOffPolicy
,ExponentialBackOffPolicy
) throw aBackOffInterruptedException
without restoring the flag.Do you think it is possible to restore the flag before throwing the runtime exception?
I can open a PR.
Thank you!
Footnotes
Google Books ↩
The text was updated successfully, but these errors were encountered: