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

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

                Author: ASF GitHub Bot
            Created on: 14/Dec/21 04:14
            Start Date: 14/Dec/21 04:14
    Worklog Time Spent: 10m 
      Work Description: jbertram commented on a change in pull request #3817:
URL: https://github.com/apache/activemq-artemis/pull/3817#discussion_r768303343



##########
File path: 
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/FileLockNodeManager.java
##########
@@ -355,7 +355,7 @@ private byte getState() throws NodeManagerException {
                result = bb.get(0);
             }
          } finally {
-            if (lock != null) {
+            if (lock != null && lock.isValid()) {

Review comment:
       Although this isn't on a hot path, generating the exception is expensive 
so I figured it would be best to avoid it if possible.




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


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

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

> Failure when shutting down the broker
> -------------------------------------
>
>                 Key: ARTEMIS-3145
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3145
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 2.16.0
>            Reporter: Emmanuel Hugonnet
>            Assignee: Justin Bertram
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> While shutting down the broker in WildFly we came along the following issue:
> {noformat}
> 2021-02-23 13:17:50,852 INFO  [org.apache.activemq.artemis.ra] (ServerService 
> Thread Pool -- 39) AMQ151003: resource adaptor stopped
> 2021-02-23 13:17:50,994 ERROR 
> [org.apache.activemq.artemis.core.server.impl.FileLockNodeManager] (Thread-1 
> (ActiveMQ-scheduled-threads)) java.nio.channels.ClosedChannelException: 
> org.apache.activemq.artemis.core.server.NodeManager$NodeManagerException: 
> java.nio.channels.ClosedChannelException
>       at 
> org.apache.activemq.artemis.core.server.impl.FileLockNodeManager.getState(FileLockNodeManager.java:364)
>       at 
> org.apache.activemq.artemis.core.server.impl.FileLockNodeManager.access$500(FileLockNodeManager.java:36)
>       at 
> org.apache.activemq.artemis.core.server.impl.FileLockNodeManager$MonitorLock.run(FileLockNodeManager.java:516)
>       at 
> org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent.runForExecutor(ActiveMQScheduledComponent.java:313)
>       at 
> org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent.bookedRunForScheduler(ActiveMQScheduledComponent.java:328)
>       at 
> org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent.runForScheduler(ActiveMQScheduledComponent.java:339)
>       at 
> org.apache.activemq.artemis.core.server.ActiveMQScheduledComponent.lambda$start$0(ActiveMQScheduledComponent.java:166)
>       at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
>       at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
>       at 
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>       at 
> org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)
> Caused by: java.nio.channels.ClosedChannelException
>       at sun.nio.ch.FileLockImpl.release(FileLockImpl.java:58)
>       at 
> org.apache.activemq.artemis.core.server.impl.FileLockNodeManager.getState(FileLockNodeManager.java:358)
>       ... 13 more
> 2021-02-23 13:17:50,997 WARN  
> [org.apache.activemq.artemis.core.server.impl.FileLockNodeManager] (Thread-1 
> (ActiveMQ-scheduled-threads)) Lost the lock according to the monitor, 
> notifying listeners
> 2021-02-23 13:17:51,493 WARN  
> [org.apache.activemq.artemis.core.server.impl.FileLockNodeManager] 
> (ServerService Thread Pool -- 39) Failure when accessing a lock file: 
> java.nio.channels.ClosedChannelException
>       at sun.nio.ch.FileChannelImpl.ensureOpen(FileChannelImpl.java:110)
>       at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1100)
>       at java.nio.channels.FileChannel.tryLock(FileChannel.java:1155)
>       at 
> org.apache.activemq.artemis.core.server.impl.FileLockNodeManager.tryLock(FileLockNodeManager.java:389)
>       at 
> org.apache.activemq.artemis.core.server.impl.FileLockNodeManager.lock(FileLockNodeManager.java:408)
>       at 
> org.apache.activemq.artemis.core.server.impl.FileLockNodeManager.writeFileLockStatus(FileLockNodeManager.java:328)
>       at 
> org.apache.activemq.artemis.core.server.impl.FileLockNodeManager.setPaused(FileLockNodeManager.java:308)
>       at 
> org.apache.activemq.artemis.core.server.impl.FileLockNodeManager.pauseLiveServer(FileLockNodeManager.java:268)
>       at 
> org.apache.activemq.artemis.core.server.impl.LiveOnlyActivation.close(LiveOnlyActivation.java:104)
>       at 
> org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.stop(ActiveMQServerImpl.java:1361)
>       at 
> org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.stop(ActiveMQServerImpl.java:1165)
>       at 
> org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.stop(ActiveMQServerImpl.java:1137)
>       at 
> org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.stop(ActiveMQServerImpl.java:948)
>       at 
> org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.stop(ActiveMQServerImpl.java:942)
>       at 
> org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl.stop(JMSServerManagerImpl.java:394)
>       at 
> org.wildfly.extension.messaging.activemq.jms.JMSService.doStop(JMSService.java:223)
>       at 
> org.wildfly.extension.messaging.activemq.jms.JMSService.access$100(JMSService.java:65)
>       at 
> org.wildfly.extension.messaging.activemq.jms.JMSService$2.run(JMSService.java:122)
>       at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>       at 
> org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
>       at 
> org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
>       at 
> org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
>       at 
> org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
>       at java.lang.Thread.run(Thread.java:748)
>       at org.jboss.threads.JBossThread.run(JBossThread.java:513)
> 2021-02-23 13:19:58,201 INFO  [org.jboss.as.server] (Thread-2) WFLYSRV0220: 
> Server shutdown has been requested via an OS signal
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to