Skip to content

Commit

Permalink
Fix HashedWheelTimeoutScheduler removing scheduledFutures after task
Browse files Browse the repository at this point in the history
  • Loading branch information
berinhardt committed Jul 26, 2024
1 parent 08359a3 commit 99eea0a
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 99eea0a

Please sign in to comment.