Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

postPrimary called twice

Hi, One of my polling container's postPrimary is called twice:

at com.mypackeage.MyContainer.postPrimary(MyContainer.java:82)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.openspaces.core.space.mode.registry.ModeAnnotationRegistry.fireEvent(ModeAnnotationRegistry.java:164)
at org.openspaces.core.space.mode.registry.ModeAnnotationRegistry.onAfterPrimary(ModeAnnotationRegistry.java:135)
at org.openspaces.core.space.AbstractSpaceFactoryBean.fireSpaceAfterPrimaryEvent(AbstractSpaceFactoryBean.java:392)
at org.openspaces.core.space.AbstractSpaceFactoryBean.onApplicationEvent(AbstractSpaceFactoryBean.java:266)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:324)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:326)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:929)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:467)
at org.openspaces.core.space.mode.SpaceModeContextLoader.loadApplicationContext(SpaceModeContextLoader.java:219)
at org.openspaces.core.space.mode.SpaceModeContextLoader.onApplicationEvent(SpaceModeContextLoader.java:163)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:324)
at org.openspaces.core.space.AbstractSpaceFactoryBean.onApplicationEvent(AbstractSpaceFactoryBean.java:259)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:324)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:929)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:467)
at org.openspaces.pu.container.integrated.IntegratedProcessingUnitContainerProvider.createContainer(IntegratedProcessingUnitContainerProvider.java:273)
at org.openspaces.pu.container.servicegrid.PUServiceBeanImpl.startPU(PUServiceBeanImpl.java:637)
at org.openspaces.pu.container.servicegrid.PUServiceBeanImpl.doStart(PUServiceBeanImpl.java:223)
at org.jini.rio.jsb.ServiceBeanAdapter$1.run(ServiceBeanAdapter.java:293)
at org.jini.rio.jsb.ServiceBeanAdapter.start(ServiceBeanAdapter.java:306)
at org.jini.rio.jsb.JSBLoader.create(JSBLoader.java:106)
at org.jini.rio.cybernode.ServiceBeanLoader.load(ServiceBeanLoader.java:276)
at org.jini.rio.cybernode.JSBDelegate.startServiceBean(JSBDelegate.java:474)
at org.jini.rio.cybernode.JSBDelegate.load(JSBDelegate.java:329)
at org.jini.rio.cybernode.JSBContainer.activate(JSBContainer.java:213)
at org.jini.rio.cybernode.CybernodeImpl.instantiate(CybernodeImpl.java:1053)
at org.jini.rio.core.provision.ServiceBeanInstantiatorGigaspacesMethodinternalInvoke3.internalInvoke(Unknown Source)
at com.gigaspaces.internal.reflection.fast.AbstractMethod.invoke(AbstractMethod.java:41)
at com.gigaspaces.lrmi.LRMIRuntime.invoked(LRMIRuntime.java:426)
at com.gigaspaces.lrmi.nio.Pivot.consumeAndHandleRequest(Pivot.java:517)
at com.gigaspaces.lrmi.nio.Pivot.handleRequest(Pivot.java:611)
at com.gigaspaces.lrmi.nio.Pivot$ChannelEntryTask.run(Pivot.java:195)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)



at at com.mypackeage.MyContainer.postPrimary(MyContainer.java:82)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.openspaces.core.space.mode.registry.ModeAnnotationRegistry.fireEvent(ModeAnnotationRegistry.java:164)
at org.openspaces.core.space.mode.registry.ModeAnnotationRegistry.onAfterPrimary(ModeAnnotationRegistry.java:135)
at org.openspaces.core.space.AbstractSpaceFactoryBean.fireSpaceAfterPrimaryEvent(AbstractSpaceFactoryBean.java:392)
at org.openspaces.core.space.AbstractSpaceFactoryBean.onApplicationEvent(AbstractSpaceFactoryBean.java:266)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:324)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:929)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:467)
at org.openspaces.pu.container.integrated.IntegratedProcessingUnitContainerProvider.createContainer(IntegratedProcessingUnitContainerProvider.java:273)
at org.openspaces.pu.container.servicegrid.PUServiceBeanImpl.startPU(PUServiceBeanImpl.java:637)
at org.openspaces.pu.container.servicegrid.PUServiceBeanImpl.doStart(PUServiceBeanImpl.java:223)
at org.jini.rio.jsb.ServiceBeanAdapter$1.run(ServiceBeanAdapter.java:293)
at org.jini.rio.jsb.ServiceBeanAdapter.start(ServiceBeanAdapter.java:306)
at org.jini.rio.jsb.JSBLoader.create(JSBLoader.java:106)
at org.jini.rio.cybernode.ServiceBeanLoader.load(ServiceBeanLoader.java:276)
at org.jini.rio.cybernode.JSBDelegate.startServiceBean(JSBDelegate.java:474)
at org.jini.rio.cybernode.JSBDelegate.load(JSBDelegate.java:329)
at org.jini.rio.cybernode.JSBContainer.activate(JSBContainer.java:213)
at org.jini.rio.cybernode.CybernodeImpl.instantiate(CybernodeImpl.java:1053)
at org.jini.rio.core.provision.ServiceBeanInstantiatorGigaspacesMethodinternalInvoke3.internalInvoke(Unknown Source)
at com.gigaspaces.internal.reflection.fast.AbstractMethod.invoke(AbstractMethod.java:41)
at com.gigaspaces.lrmi.LRMIRuntime.invoked(LRMIRuntime.java:426)
at com.gigaspaces.lrmi.nio.Pivot.consumeAndHandleRequest(Pivot.java:517)
at com.gigaspaces.lrmi.nio.Pivot.handleRequest(Pivot.java:611)
at com.gigaspaces.lrmi.nio.Pivot$ChannelEntryTask.run(Pivot.java:195)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)

This was tested both with GS 9.0.2 and 9.7.2, calls are the same only line number differences, logs posted are from 9.0.2.

Other then having this call twice processing the events seem working correct (only once poll).

Yes, we have a SpaceModeContextBean.

The instance of MyContainer on which it is called is the same one.

It even passes the check:

    public void postPrimary(AfterSpaceModeChangeEvent event) {
    if (SpaceUtils.isSameSpace(gigaSpace.getSpace(), event.getSpace())) { //gigaSpace autowired

Why is this happening? Is there anything to actually worry about regarding the event processing which I may not discovered yet? Thanks

asked 2016-02-18 03:09:53 -0500

lukeh gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

I have tried a simple test and I am not able to reproduce this. How are you instantiating the IntegratedProcessingUnitContainer? Or if you prefer, please open a support ticket and we can work with you to troubleshoot this.

answered 2016-02-18 16:10:48 -0500

Dixson Huie gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-02-18 03:09:53 -0500

Seen: 485 times

Last updated: Feb 18 '16