8
8
package com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.partitionedCache;
9
9
10
10
import com.oracle.coherence.common.base.Blocking;
11
+ import com.oracle.coherence.common.base.TimeHelper;
11
12
import com.oracle.coherence.persistence.PersistentStore;
12
13
import com.tangosol.coherence.component.net.Lease;
13
14
import com.tangosol.coherence.component.net.MemberSet;
@@ -737,6 +738,12 @@ public class Storage
737
738
738
739
private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
739
740
741
+ /**
742
+ * The maximum accepted value used in {#link {@link #scheduleEviction(long)}}.
743
+ * This equals {@link Long#MAX_VALUE} minus millis in one day
744
+ */
745
+ private static final long MAX_EXPIRY = Long.MAX_VALUE - TimeUnit.DAYS.toMillis(1);
746
+
740
747
// Static initializer
741
748
static
742
749
{
@@ -9100,15 +9107,12 @@ protected static void rethrow(Throwable e)
9100
9107
* Schedule to run the eviction task at specified expiry delay
9101
9108
* (cExpiryMillis) if no task is currently scheduled. Cancel the
9102
9109
* existing task and create a new one if new expiry time is sooner than
9103
- * previosely scheduled one.
9110
+ * previously scheduled one.
9104
9111
*
9105
9112
* @param cExpiryMillis expiry delay in millis
9106
9113
*/
9107
9114
public synchronized void scheduleEviction(long cExpiryMillis)
9108
9115
{
9109
- // import Component.Util.DaemonPool as com.tangosol.coherence.component.util.DaemonPool;
9110
- // import com.tangosol.util.Base;
9111
-
9112
9116
com.tangosol.coherence.component.util.DaemonPool pool = getService().getDaemonPool();
9113
9117
9114
9118
if (!pool.isStarted())
@@ -9126,7 +9130,22 @@ public synchronized void scheduleEviction(long cExpiryMillis)
9126
9130
}
9127
9131
9128
9132
long ldtOldNext = task.getEvictionTime();
9129
- long ldtNewNext = Base.getSafeTimeMillis() + cExpiryMillis;
9133
+ long ldtNow = TimeHelper.getSafeTimeMillis();
9134
+ long ldtMax = MAX_EXPIRY - ldtNow;
9135
+
9136
+ long ldtNewNext;
9137
+ long ldtSchedule;
9138
+
9139
+ if (cExpiryMillis < ldtMax)
9140
+ {
9141
+ ldtNewNext = ldtNow + cExpiryMillis;
9142
+ ldtSchedule = cExpiryMillis;
9143
+ }
9144
+ else
9145
+ {
9146
+ ldtNewNext = MAX_EXPIRY;
9147
+ ldtSchedule = MAX_EXPIRY - ldtNow;
9148
+ }
9130
9149
9131
9150
task.setPrune(cExpiryMillis == 0L);
9132
9151
0 commit comments