jamesnetherton commented on code in PR #19568:
URL: https://github.com/apache/camel/pull/19568#discussion_r2431608498
##########
components/camel-file/src/main/java/org/apache/camel/component/file/cluster/FileLockClusterView.java:
##########
@@ -33,13 +33,19 @@
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
+import java.util.concurrent.locks.ReentrantLock;
import org.apache.camel.cluster.CamelClusterMember;
import org.apache.camel.support.cluster.AbstractCamelClusterView;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class FileLockClusterView extends AbstractCamelClusterView {
+
+ // Used only during service startup as each context could try to access it
concurrently.
+ // It isolates the critical section making sure only one service creates
the files.
+ private static ReentrantLock contextStartLock = new ReentrantLock();
Review Comment:
Nitpick
```suggestion
private static final ReentrantLock contextStartLock = new
ReentrantLock();
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]