[
https://issues.jboss.org/browse/AS7-3695?page=com.atlassian.jira.plugin.s...
]
Richard Achmatowicz edited comment on AS7-3695 at 2/10/12 11:15 AM:
--------------------------------------------------------------------
There was another problem here: if you create a cache container, create a cache inside of
it and then remove the container, even with the above fix, the services for the child
caches get stopped but they do not get removed from the ServiceRegistry. Consulted with
Brian and he confirmed that this is the case: child services of a removed service will get
stopped but not removed when the parent is removed. Starting the same cache container
again causes the left over cache services to start up again as well, which is puzzling.
Because of the fact that each cache, in addition to having a CacheConfigurationService and
a CacheService installed, also has a BinderService installed to manage the JNDI name, and
because the format of the JNDI name is rather arbirary and can't be removed based on
the container name only, to properly remove all existing cache services from the
ServiceRegistry before removing the container, we need to lookup all existing caches in
the container in the MODEL phase (before that information is removed from the model) and
then use that information in the RUNTIME phase to actually remove the services.
The current pull request performs these steps.
was (Author: rachmato):
There was another problem here: if you create a cache container, create a cache inside
of it and then remove the container, even with the above fix, the services for the child
caches get stopped but they do not get removed from the ServiceRegistry. Consulted with
Brian and he confirmed that this is the case: child services of a removed service will get
stopped but not removed when the parent is removed. Starting the same cache container
again causes the left over cache services to start up again as well, which is puzzling.
So, I have added in a step at the beginning of the code segment above to remove any
existing cache services left in the container before removing the container itself:
{noformat}
List<ServiceName> serviceNames = context.getServiceRegistry(false).getServiceNames()
;
for (ServiceName serviceName : serviceNames) {
if
(serviceName.toString().startsWith(EmbeddedCacheManagerService.getServiceName(name).toString()))
{
context.removeService(serviceName) ;
}
}
{noformat}
Management: infinispan cache-container remove operation does not
really remove container
----------------------------------------------------------------------------------------
Key: AS7-3695
URL:
https://issues.jboss.org/browse/AS7-3695
Project: Application Server 7
Issue Type: Bug
Components: Clustering, Domain Management
Affects Versions: 7.1.0.Final
Reporter: Dominik Pospisil
Assignee: Richard Achmatowicz
Labels: eap6_prd_req
Management: infinispan cache-container remove operation does not really remove container.
Subsequent add operation fails.
Steps to reproduce:
[standalone@localhost:9999 subsystem=infinispan]
./cache-container=test2:add(start="EAGER")
{"outcome" => "success"}
[standalone@localhost:9999 subsystem=infinispan] ./cache-container=test2:remove
{"outcome" => "success"}
[standalone@localhost:9999 subsystem=infinispan]
./cache-container=test2:add(start="EAGER")
{
"outcome" => "failed",
"failure-description" => "JBAS014749: Operation handler failed:
Service jboss.naming.context.java.jboss.infinispan.container.test2 is already
registered",
"rolled-back" => true
}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira