Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

JGRP-1457 don't lose scheduled tasks

  • Loading branch information...
commit 624039a756c8ad60cf896cc5364f1c3d65b42202 1 parent d77c440
@dimbleby dimbleby authored committed
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/org/jgroups/util/TimeScheduler2.java
View
9 src/org/jgroups/util/TimeScheduler2.java
@@ -162,8 +162,9 @@ public void execute(Runnable task) {
}
if((retval=existing.add(work)) != null)
break;
- else // entry has completed; remove it. This will create a new Entry at the top of the loop
- tasks.remove(key);
+
+ // Else the existing entry is completed. It'll be removed shortly, so we just loop round again.
+ // Don't remove the entry ourselves - see JGRP-1457.
}
if(key < next_execution_time || no_tasks.compareAndSet(true, false)) {
@@ -393,7 +394,7 @@ protected void stopRunner() {
}
-
+
private static class Entry {
private final MyTask task; // the task (wrapper) to execute
@@ -579,7 +580,7 @@ public void doSchedule() {
log.trace("task will not get rescheduled as interval is " + next_interval);
return;
}
-
+
future=schedule(this, next_interval, TimeUnit.MILLISECONDS);
if(cancelled)
future.cancel(true);
Please sign in to comment.
Something went wrong with that request. Please try again.