-
Bug
-
Resolution: Done
-
Major
-
JBoss A-MQ 6.2.1
I have two instances (A and B) in shared filesystem master slave configuration are deployed (A is master B is slave). When I simulate network failure between master and NFS server then B becomes master and A starts its shutdown procedure. A's shutdowns procedure throws exceptions related to I/O error (see attached log file) since kahaDB folder on shared NFS is unreachable and A does shut down.
But when I stop broker B (which is currently master), reestablish connection between A and NFS server and manually restart broker on A. Then it claims that DB is locked and broker on A will never start (which is bad especially in case that broker is restarted automatically by setting restartAllowed="true" in activemq.xml). Only solution to successfully start broker on A is to stop whole Fuse and start it again.
When debug logging is enabled on SharedFileLocker class it claims that:
08:42:19,559 | DEBUG | AMQ-2-thread-1 | SharedFileLocker | 140 - org.apache.activemq.activemq-osgi - 5.11.0.redhat-621032 | Database /mnt/nfs/fuse-shared/standaloneFaframTest/lock is locked... waiting 10 seconds for the database to be unlocked. Reason: java.io.IOException: File '/mnt/nfs/fuse-shared/standaloneFaframTest/lock' could not be locked as lock is already held for this jvm.
So it look like that A still holds the lock but it is not possible since in between B instance was a master.
Persistent storage configuration:
<persistenceAdapter> <kahaDB directory="/mnt/nfs/fuse-shared/standaloneFaframTest/" lockKeepAlivePeriod="2000"> <locker> <shared-file-locker lockAcquireSleepInterval="10000" /> </locker> </kahaDB> </persistenceAdapter>