franz1981 edited a comment on pull request #3572:
URL: https://github.com/apache/activemq-artemis/pull/3572#issuecomment-841618355


   @TomasHofman I see that you've worked on 
https://issues.apache.org/jira/browse/ARTEMIS-3037.
   My changes for https://issues.apache.org/jira/browse/ARTEMIS-3290  are 
merging the append attempt with the `checkKnowRecordID` while happening on the 
appender thread.
   
   I'm not sure I can see the issue re 
https://issues.apache.org/jira/browse/ARTEMIS-3037 so I don't know if/how I 
should fix it now.
   I see that there is no way to make read lock lock to throw any exception, 
see:
   ```java
      public static void main(String[] args) throws InterruptedException {
         ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
         lock.writeLock().lock();
         CountDownLatch started = new CountDownLatch(1);
         final AtomicBoolean tryLock = new AtomicBoolean();
         Thread t = new Thread(() -> {
            started.countDown();
            while (!tryLock.get()) {
   
            }
            System.out.println("try lock");
            try {
               lock.readLock().lock();
            } catch (Throwable err) {
               err.printStackTrace();
            } finally {
               System.out.println("EXIT!");
            }
         });
         t.start();
         started.await();
         t.interrupt();
         tryLock.set(true);
         System.out.println("INTERRUPT!");
      }
   ```


-- 
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]


Reply via email to