franz1981 commented on a change in pull request #2909: ARTEMIS-2567 restore
locking semantics on server.lock when reading st…
URL: https://github.com/apache/activemq-artemis/pull/2909#discussion_r354478251
##########
File path:
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java
##########
@@ -108,7 +108,16 @@ public synchronized void start() throws Exception {
protected synchronized void setUpServerLockFile() throws IOException {
super.setUpServerLockFile();
- for (int i = 0; i < 3; i++) {
+ if (lockChannels[0] == null || !lockChannels[0].isOpen()) {
+ File fileLock = newFile(NodeManager.SERVER_LOCK_NAME);
+ if (!fileLock.exists()) {
+ fileLock.createNewFile();
+ }
+ RandomAccessFile randomFileLock = new RandomAccessFile(fileLock,
"rw");
Review comment:
You save to create one instance that will reference the same file
descriptor, but as I've said is a minor thing :)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services