From b72d01a6ef05d2f473d02ae6c2d600a02733d0ab Mon Sep 17 00:00:00 2001 From: David Turner Date: Tue, 18 Dec 2018 15:28:21 +0000 Subject: [PATCH] RecoveryMonitor#lastSeenAccessTime should be volatile This local field is accessed on multiple threads and is nonvolatile so theoretically could yield stale values. Not sure it does in practice. --- .../elasticsearch/indices/recovery/RecoveriesCollection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/org/elasticsearch/indices/recovery/RecoveriesCollection.java b/server/src/main/java/org/elasticsearch/indices/recovery/RecoveriesCollection.java index bbb02231e7a59..6b442750c1898 100644 --- a/server/src/main/java/org/elasticsearch/indices/recovery/RecoveriesCollection.java +++ b/server/src/main/java/org/elasticsearch/indices/recovery/RecoveriesCollection.java @@ -258,7 +258,7 @@ private class RecoveryMonitor extends AbstractRunnable { private final long recoveryId; private final TimeValue checkInterval; - private long lastSeenAccessTime; + private volatile long lastSeenAccessTime; private RecoveryMonitor(long recoveryId, long lastSeenAccessTime, TimeValue checkInterval) { this.recoveryId = recoveryId;