Details
-
Bug
-
Resolution: Done
-
Major
-
JBoss A-MQ 6.0
-
None
Description
In org.apache.activemq.store.jdbc.LeaseDatabaseLocker the ".handleIOException(ioe)" invocation (in code below) will throw an org.apache.activemq.broker.SuppressReplyException rather than the original IOException. The SuppressReplyException is a RuntimeException and will bubble up to the ScheduleThreadPoolExecutor . This will stop the scheduled task used for checking/renewing the lease.| ...|
public class LeaseDatabaseLocker extends AbstractLocker { |
... |
public boolean keepAlive() throws IOException { |
... |
try{ |
... |
{color:black}} catch (Exception e) {{color} |
LOG.warn(getLeaseHolderId() + ", failed to update lease: " + e, e); |
IOException ioe = IOExceptionSupport.create(e); |
persistenceAdapter.getBrokerService().handleIOException(ioe); |
throw ioe; |
{color:black}} finally {{color} |
close(statement); |
close(connection); |
{color:black}} |
The broker may still acquire the lease as JDBCIOExceptionHandler also calls keepalive when dealing with an SQLException. After the JDBCIOExceptionHandler has dealt with the SQLException the broker will not renew the lease (or check it) and the slave broker will acquire the lease when the lease period expires. This leads to a scenario where both brokers believe they are the master.