Skip to content

Commit

Permalink
Merge pull request #991 from berinhardt/master
Browse files Browse the repository at this point in the history
Fix HashedWheelTimeoutScheduler removing scheduledFutures after task
  • Loading branch information
mrniko authored Jul 27, 2024
2 parents 08359a3 + 99eea0a commit 6981e0c
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,8 @@ public void run(Timeout timeout) throws Exception {
ctx.executor().execute(new Runnable() {
@Override
public void run() {
try {
runnable.run();
} finally {
scheduledFutures.remove(key);
}
scheduledFutures.remove(key);
runnable.run();
}
});
}
Expand All @@ -98,11 +95,8 @@ public void schedule(final SchedulerKey key, final Runnable runnable, long delay
Timeout timeout = executorService.newTimeout(new TimerTask() {
@Override
public void run(Timeout timeout) throws Exception {
try {
runnable.run();
} finally {
scheduledFutures.remove(key);
}
scheduledFutures.remove(key);
runnable.run();
}
}, delay, unit);

Expand Down

0 comments on commit 6981e0c

Please sign in to comment.