[jboss-jira] [JBoss JIRA] Commented: (JBAS-2520) HASingleton cannot be redeployed if stopSingleton() throws an Exception
Scott Marlow (JIRA)
jira-events at lists.jboss.org
Fri Feb 27 13:54:55 EST 2009
[ https://jira.jboss.org/jira/browse/JBAS-2520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12454769#action_12454769 ]
Scott Marlow commented on JBAS-2520:
------------------------------------
We could implement the extra "on-failure" actions. Or we could enhance the HA clustering documentation (and/or wiki) to require that user applications handle all checked/unchecked exceptions that are thrown from their code. This could be considered part of the contract and avoids forcing the developer to deal with the additional complexity of the on-failure actions (they have to configure which one they want).
The current workaround is that we catch Exceptions thrown by the application stopSingleton() and log the following warning (on the cluster node that is no longer the singleton master):
_stopOldMaster failed. Will still try to start new master. You need to examine the reason why the old master wouldn't stop and resolve it. It is bad that the old singleton may still be running while we are starting a new one, so you need to resolve this ASAP.;
The best solution would be to add a new keyword to Java that allows an interface to specify that unchecked exceptions must not be thrown (forces the developer to catch them). Maybe something like:
public interface HASingleton
{
void startSingleton() prevent unchecked;
void stopSingleton() prevent unchecked;
}
> HASingleton cannot be redeployed if stopSingleton() throws an Exception
> -----------------------------------------------------------------------
>
> Key: JBAS-2520
> URL: https://jira.jboss.org/jira/browse/JBAS-2520
> Project: JBoss Application Server
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Clustering
> Affects Versions: JBossAS-4.0.3 SP1
> Environment: Java 1.5.0_04 on RHEL 4
> Reporter: Mirko Nasato
> Assignee: Brian Stansberry
> Fix For: Backlog
>
> Attachments: ha-test.sar.zip
>
>
> If a Service MBean is a Clustered HA Singleton (it extends HASingletonSupport, or it is run by HASingletonController) and it throws an Exception when stopping then it is impossible to redeploy that Service until the whole JBoss is restarted.
> Any attempts at deploying the Service will results in the following error
> 15:47:43,766 WARN [ServiceController] Problem starting service hatest:service=MyHASingletonService
> java.lang.NullPointerException
> at org.jboss.ha.jmx.HAServiceMBeanSupport.getServiceHAName(HAServiceMBeanSupport.java:361)
> at org.jboss.ha.jmx.HAServiceMBeanSupport$1.replicantsChanged(HAServiceMBeanSupport.java:195)
> ...
> and then
> --- MBeans waiting for other MBeans ---
> ObjectName: hatest:service=MyHASingletonService
> State: FAILED
> Reason: java.lang.NullPointerException
> I Depend On:
> jboss:service=DefaultPartition
> --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
> ObjectName: hatest:service=MyHASingletonService
> State: FAILED
> Reason: java.lang.NullPointerException
> I Depend On:
> jboss:service=DefaultPartition
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list