diff --git a/aeron-driver/src/main/java/io/aeron/driver/DriverNameResolver.java b/aeron-driver/src/main/java/io/aeron/driver/DriverNameResolver.java index 583fe4b2aa..d9ea52be5a 100644 --- a/aeron-driver/src/main/java/io/aeron/driver/DriverNameResolver.java +++ b/aeron-driver/src/main/java/io/aeron/driver/DriverNameResolver.java @@ -158,7 +158,7 @@ public int doWork(final long nowMs) { int workCount = 0; - if (nowMs > workDeadlineMs) + if (workDeadlineMs - nowMs < 0) { workDeadlineMs = nowMs + WORK_INTERVAL_MS; workCount += transport.poll(this, nowMs); diff --git a/aeron-driver/src/main/java/io/aeron/driver/DriverNameResolverCache.java b/aeron-driver/src/main/java/io/aeron/driver/DriverNameResolverCache.java index ccc4f5152c..714b369d04 100644 --- a/aeron-driver/src/main/java/io/aeron/driver/DriverNameResolverCache.java +++ b/aeron-driver/src/main/java/io/aeron/driver/DriverNameResolverCache.java @@ -96,7 +96,7 @@ int timeoutOldEntries(final long nowMs, final AtomicCounter cacheEntriesCounter) { final CacheEntry entry = listOfEntries.get(i); - if (nowMs > entry.deadlineMs) + if (entry.deadlineMs - nowMs < 0) { ArrayListUtil.fastUnorderedRemove(listOfEntries, i, lastIndex--); cacheEntriesCounter.setOrdered(listOfEntries.size());