Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
When TaskCallbackImpl.failure is called, the scheduledFuture in the TaskCallbackImpl object gets cancelled. However, in the failure case of hitting the task callback timeout, then it is the scheduledFuture that is calling TaskCallbackImpl.failure. Therefore, the scheduledFuture is calling cancel on itself. This may impact the execution of the thread if the interrupted status is ever checked. For example, StreamAppender uses a BlockingQueue to store messages, but that will check if the thread is interrupted and not handle the "append" correctly. Once a thread interrupted state is checked, it gets cleared, so further execution is not impacted, but it still causes some odd and hard-to-track behavior.
Since we want the scheduledFuture to run in the timeout case, it should not cancel itself.