[Design of JCA on JBoss] - JBAS-5929 - Idle subpools
by adrian@jboss.org
We need a mechanism to clear up unused subpools otherwise
they could potentially grow without bounds.
The simplest mechanism I'd suggest is for the
InternalManagedConnectionPool.removeIdleConnections() to notify the
JBossManagedConnectionPool when the pool has become empty.
Problem 1: The IMCP doesn't currently hold a reference to the JMCP it belongs to.
The JBossManagedConnectionPool::BasePool can then decide whether
to remove the pool if it is subpooling, e.g.
| public void emptySubPool(InternalManagedConnectionPool pool)
| {
| synchronized (subPools)
| {
| for (Iterator i = subPools.values().iterator(); i.hasNext(); )
| {
| SubPoolContext subPool = (SubPoolContext) i.next();
| InternalManagedConnectionPool other = sub.getSubPool();
| if (subPool == pool && pool.isEmpty())
| {
| pool.shutdown();
| i.remove();
| break;
| }
| }
| subPools.clear();
| }
| }
|
NOTE: The JBossManagedConnectionPool has to "double check"
the pool is really empty since somebody could have jumped in
and requested a connection from the pool between the empty notification
from the ICMP and the JMCP actually trying to remove it.
But see below.
Problem 2: There is still a race condition here.
The "double check" is not good enough,
since only the subpool retrieval will be synchronized with it.
BasePool::getConnection()
| SubPoolContext subPool = getSubPool(key, subject, cri); // HERE! This part synchronizes on sub-pools, the rest does not.
|
| InternalManagedConnectionPool mcp = subPool.getSubPool();
|
| // Are we doing track by connection?
| TransactionLocal trackByTx = subPool.getTrackByTx();
|
| // Simple case
| if (trackByTransaction == null || trackByTx == null)
| {
| ConnectionListener cl = mcp.getConnection(subject, cri);
| if (traceEnabled)
| dump("Got connection from pool " + cl);
| return cl;
| }
|
So the mcp.getConnection() part could find the pool has been shutdown
by the idle remover after it retrieved the now removed sub-pool.
The simplest way to resolve this race condition would be to
implement the "retries" feature request.
https://jira.jboss.org/jira/browse/JBAS-3997
where if this race condition goes the wrong way, the connection manager
would just trap the "transient failure" and redo the request.
i.e. the pool is shutdown error would be a RetryableResourceException
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4174502#4174502
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4174502
17 years, 7 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Re: Paging discussion:
by clebert.suconic@jboss.com
"clebert.suconic(a)jboss.com" wrote :
| - I still want to change journal reload to use a FileChannel instead of loading the whole file in memory. Maybe this will be done as part of the journal optimization task later.
This is actually not viable.
Because the way we are validating holes, transaction health and other things. We move a lot around the buffer to make sure the register being read is valid, that there are not holes and other things like that.
Because of that it is not possible to replace the Buffer by a streaming, as reading those files without a Buffer would be too costly.
I've done a quick prototype and the reading time was prohibitive.
I will try to improve how the memory is read by some other optimization. (Maybe reusing the same buffer along all the files, what is quite possible).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4174433#4174433
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4174433
17 years, 7 months
[Design of AOP on JBoss (Aspects/JBoss)] - ConcurrentModificationException issues
by scott.stark@jboss.org
Its been reported that some seam apps on jbossas 5 trunk are failing to deploy due to the following exceptions:
| 13:10:44,252 INFO [EJBContainer] STARTED EJB: org.jboss.seam.example.remoting.chatroom.ChatRoomAction ejbName: ChatRoomAction
| 13:10:44,261 WARN [SessionSpecContainer] Populating JBoss-specific annotation metadata manually until done by deployers: jboss.j2ee:ear=jboss-seam-chatroom.ear,jar=jboss-seam-chatroom.jar,name=ChatRoomAction,service=EJB3
| 13:10:44,846 INFO [EJBContainer] STARTED EJB: org.jboss.seam.example.remoting.chatroom.LoggerBean ejbName: LoggerBean
| 13:10:45,291 ERROR [AbstractKernelController] Error installing to Described: name=jboss.j2ee:ear=jboss-seam-chatroom.ear,jar=jboss-seam.jar,name=TimerServiceDispatcher,service=EJB3 state=PreInstall
| java.util.ConcurrentModificationException
| at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:365)
| at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:376)
| at org.jboss.aop.ReflectiveAspectBinder.bindMethodAdvice(ReflectiveAspectBinder.java:310)
| at org.jboss.aop.ReflectiveAspectBinder.bindMethodAdvices(ReflectiveAspectBinder.java:193)
| at org.jboss.aop.ReflectiveAspectBinder.getAspects(ReflectiveAspectBinder.java:96)
| at org.jboss.aop.microcontainer.integration.AOPDependencyBuilder.getDependencies(AOPDependencyBuilder.java:103)
| at org.jboss.kernel.plugins.dependency.DescribeAction.installActionInternal(DescribeAction.java:56)
| at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
| at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
| at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
| at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
| at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1522)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:898)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1026)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:948)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:738)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:506)
| at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:124)
| at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
| at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
| at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
| at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:970)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:991)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1023)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:911)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1522)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:898)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1026)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:948)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:786)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:519)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:594)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:265)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:143)
| at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:409)
| at org.jboss.Main.boot(Main.java:209)
| at org.jboss.Main$1.run(Main.java:544)
| at java.lang.Thread.run(Thread.java:595)
| 13:10:45,382 ERROR [AbstractKernelController] Error installing to Described: name=jboss.j2ee:ear=jboss-seam-chatroom.ear,jar=jboss-seam.jar,name=EjbSynchronizations,service=EJB3 state=PreInstall
| java.util.ConcurrentModificationException
| at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(LinkedHashMap.java:365)
| at java.util.LinkedHashMap$KeyIterator.next(LinkedHashMap.java:376)
| at org.jboss.aop.ClassContainer.makeInterceptorChains(ClassContainer.java:336)
| at org.jboss.aop.ClassContainer.createInterceptorChains(ClassContainer.java:314)
| at org.jboss.aop.ClassContainer.rebuildInterceptors(ClassContainer.java:139)
| at org.jboss.aop.ClassContainer.initializeClassContainer(ClassContainer.java:73)
| at org.jboss.aop.proxy.container.ClassProxyContainer.initialise(ClassProxyContainer.java:177)
| at org.jboss.aop.proxy.container.InstanceProxyContainer.<init>(InstanceProxyContainer.java:56)
| at org.jboss.aop.proxy.container.InstanceProxyContainer.createInstanceProxyContainer(InstanceProxyContainer.java:68)
| at org.jboss.aop.proxy.container.ContainerCache.initInstanceContainer(ContainerCache.java:292)
| at org.jboss.aop.proxy.container.ContainerCache.initialise(ContainerCache.java:93)
| at org.jboss.aop.proxy.container.ContainerCache.initialise(ContainerCache.java:72)
| at org.jboss.aop.microcontainer.integration.AOPDependencyBuilder.getDependencies(AOPDependencyBuilder.java:99)
| at org.jboss.kernel.plugins.dependency.DescribeAction.installActionInternal(DescribeAction.java:56)
| at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
| at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
| at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4174415#4174415
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4174415
17 years, 7 months