Skip to content

Commit

Permalink
[hotfix] Clear interrupted flag in stream task cancellation
Browse files Browse the repository at this point in the history
We clear the interrupted flag before the cleanup code block of task cancellation.
Otherwise, code that would like to wait until services are properly shutdown will
always immediately return from calls that are supposed to be blocking waits.
  • Loading branch information
StefanRRichter committed Feb 25, 2018
1 parent a8fc3b1 commit f9a583b
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ public final void invoke() throws Exception {
// clean up everything we initialized
isRunning = false;

// clear the interrupted status so that we can wait for the following resource shutdowns to complete
Thread.interrupted();

// stop all timers and threads
if (timerService != null && !timerService.isTerminated()) {
try {
Expand Down

0 comments on commit f9a583b

Please sign in to comment.