From 2b09f5a738f4f0221248289bff90d3f8f66a1c35 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Sun, 26 Dec 2021 20:20:27 +0100 Subject: [PATCH] Update retry algorithm --- .../database/disk/OptimisticRocksDBColumn.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/it/cavallium/dbengine/database/disk/OptimisticRocksDBColumn.java b/src/main/java/it/cavallium/dbengine/database/disk/OptimisticRocksDBColumn.java index bb30524..1e60be4 100644 --- a/src/main/java/it/cavallium/dbengine/database/disk/OptimisticRocksDBColumn.java +++ b/src/main/java/it/cavallium/dbengine/database/disk/OptimisticRocksDBColumn.java @@ -159,21 +159,21 @@ public final class OptimisticRocksDBColumn extends AbstractRocksDBColumn= 5 && retries % 5 == 0 || ALWAYS_PRINT_OPTIMISTIC_RETRIES) { logger.warn(MARKER_ROCKSDB, "Failed optimistic transaction {} (update):" - + " waiting {} ms before retrying for the {} time", LLUtils.toStringSafe(key), retryMs, retries); + + " waiting {} ms before retrying for the {} time", LLUtils.toStringSafe(key), retryNs / 1000000d, retries); } else if (logger.isDebugEnabled(MARKER_ROCKSDB)) { logger.debug(MARKER_ROCKSDB, "Failed optimistic transaction {} (update):" - + " waiting {} ms before retrying for the {} time", LLUtils.toStringSafe(key), retryMs, retries); + + " waiting {} ms before retrying for the {} time", LLUtils.toStringSafe(key), retryNs / 1000000d, retries); } // Wait for n milliseconds - if (retryMs > 0) { - LockSupport.parkNanos(retryMs * 1000000L); + if (retryNs > 0) { + LockSupport.parkNanos(retryNs); } } }