[ 
https://issues.apache.org/jira/browse/ARTEMIS-2441?focusedWorklogId=288938&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-288938
 ]

ASF GitHub Bot logged work on ARTEMIS-2441:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 05/Aug/19 13:26
            Start Date: 05/Aug/19 13:26
    Worklog Time Spent: 10m 
      Work Description: clebertsuconic commented on pull request #2782: 
ARTEMIS-2441 Separate Lock Files
URL: https://github.com/apache/activemq-artemis/pull/2782#discussion_r310603307
 
 

 ##########
 File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java
 ##########
 @@ -82,6 +86,36 @@ public synchronized void start() throws Exception {
       super.start();
    }
 
+   @Override
+   protected synchronized void setUpServerLockFile() throws IOException {
+      super.setUpServerLockFile();
+
+      for (int i = 0; i < 3; i++) {
+         if (lockChannels[i] != null && lockChannels[i].isOpen()) {
+            continue;
+         }
+         File fileLock = newFile("serverlock." + i);
+         if (!fileLock.exists()) {
+            fileLock.createNewFile();
+         }
+         RandomAccessFile randomFileLock = new RandomAccessFile(fileLock, 
"rw");
+         lockChannels[i] = randomFileLock.getChannel();
+      }
+   }
+
+   @Override
+   public synchronized void stop() throws Exception {
+      for (FileChannel channel : lockChannels) {
+         try {
+            channel.close();
+         } catch (Throwable e) {
+
 
 Review comment:
   hmmm... I should have logged it here. (reviewing my own PR)
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 288938)
    Time Spent: 20m  (was: 10m)

> Use separate file for locking broker and backup
> -----------------------------------------------
>
>                 Key: ARTEMIS-2441
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2441
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>    Affects Versions: 2.9.0
>            Reporter: clebert suconic
>            Assignee: clebert suconic
>            Priority: Major
>             Fix For: 2.10.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Some file systems don't support positional locking (or record level).
>  
> A current example I bumped into is ceph-fs, however, I have had issues with 
> record locking before with certain NFS versions, GFS and others.
>  
> To make things better, I'm just splitting the locks to separate files, and 
> everything should still work the same while allowing these devices to work 
> seamless.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to