Bug 1335495 - Clustering quickstart race condition
Summary: Clustering quickstart race condition
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Clustering, Quickstarts
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Enrique Gonzalez Martinez
QA Contact: Michal Vinkler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-12 10:25 UTC by Enrique Gonzalez Martinez
Modified: 2016-05-20 14:13 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-20 14:13:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1325376 0 high CLOSED [GSS](6.4.z) Failover of HASingleton service is not correct if a Custom election policy is used and a node crash 2021-02-22 00:41:40 UTC

Internal Links: 1325376

Description Enrique Gonzalez Martinez 2016-05-12 10:25:46 UTC
{code}
jboss.quickstart.ha.singleton.timer.Eight.service: Could not initialize timer
	at org.jboss.as.quickstarts.cluster.hasingleton.service.ejb.HATimerService.start(HATimerService.java:80)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_91]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_91]
	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_91]
Caused by: javax.naming.NameNotFoundException: Error looking up global/jboss-cluster-ha-singleton-service/SchedulerEightBean!org.jboss.as.quickstarts.cluster.hasingleton.service.ejb.Scheduler, service service jboss.naming.context.java.global.jboss-cluster-ha-singleton-service."SchedulerEightBean!org.jboss.as.quickstarts.cluster.hasingleton.service.ejb.Scheduler" is not started
	at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:133)
	at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:81)
	at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:197)
	at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:243)
	at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:183)
	at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179)
	at javax.naming.InitialContext.lookup(InitialContext.java:417) [rt.jar:1.8.0_91]
	at javax.naming.InitialContext.lookup(InitialContext.java:417) [rt.jar:1.8.0_91]
	at org.jboss.as.quickstarts.cluster.hasingleton.service.ejb.HATimerService.start(HATimerService.java:77)
	... 5 more

{code}

In this case the HATimerServiceActivator does not create any dependency against the ejb component create/start service causing a race condition:

https://github.com/jboss-developer/jboss-eap-quickstarts/blob/6.4.x/cluster-ha-singleton/service/src/main/java/org/jboss/as/quickstarts/cluster/hasingleton/service/ejb/HATimerServiceActivator.java#L59

.addDependency should be called there against the right ejb component.

Comment 9 Enrique Gonzalez Martinez 2016-05-19 11:32:26 UTC
This dependency should be added there:

ServiceName component = ServiceName.of("jboss", "deployment", "unit", "jboss-cluster-ha-singleton-service.jar", "component", "Scheduler" + singletonName +"Bean", "START");

and then change the service builder:

singleton.build(new DelegatingServiceContainer(context.getServiceTarget(), context.getServiceRegistry()))
                .setInitialMode(ServiceController.Mode.ACTIVE)
                .addDependency(component)
                .install()

this is enough for fixing the problem of starting/stopping the activator. the problem is that is hardcoded.

Comment 10 Enrique Gonzalez Martinez 2016-05-20 07:04:06 UTC
sent to eap 7

https://github.com/jboss-developer/jboss-eap-quickstarts/pull/1884

Comment 11 sgilda 2016-05-20 13:09:47 UTC
Enrique,

Thanks for bringing this to our attention. I need to run this by Wolf, the owner of the quickstart, and if he agrees, we will need to close out the Bugzilla and reopen a JIRA for the quickstart component in the JBEAP project. We no longer track JBoss EAP 7 issues in Bugzilla.

Thanks,
Sande

Comment 12 Enrique Gonzalez Martinez 2016-05-20 13:15:32 UTC
@sgilda:

I didn't know how to handle properly this issue as it does not belong to the eap codebase or any components.

I did create this BZ just to keep track of the issue. Feel free to close as WON'T FIX once you open the jira in the JBEAP.

Comment 13 sgilda 2016-05-20 13:36:09 UTC
@enrique, We won't be making any changes to the 6.4 quickstarts at this point, so I will close this one out when the JIRA is created. Would you like to create the JIRA or would you like me to do it?

Comment 14 sgilda 2016-05-20 13:59:31 UTC
I'll create the JIRA and post the link here.

Comment 15 sgilda 2016-05-20 14:13:35 UTC
The JIRA for JBoss EAP 7.0 is located here: https://issues.jboss.org/browse/JBEAP-4644

Since we are no longer making fixes to the 6.4 quickstarts, I am closing this issue.


Note You need to log in before you can comment on or make changes to this bug.