[
https://jira.jboss.org/jira/browse/JBCACHE-1528?page=com.atlassian.jira.p...
]
Manik Surtani commented on JBCACHE-1528:
----------------------------------------
The "tangential thing" is irrelevant. The parameter should be named
"SkipBlockUntilStart" rather than "originLocal" since that is
misleading. I have updated the var name and comments/javadocs accordingly.
Basically a check is already done by the CommandAwareRpcDispatcher
(componentRegistry.invocationsAllowed(false)), which will block until the cache starts if
necessary. So by the time the actual invocation happens, this check should not block.
Anyway I now have a unit test for this (GravitationFromDyingNodeTest) which tests the
preference of a response from a valid node over one that is in its STOPPING state. The
test is not perfect (since it does not simulate the case where a responder is STARTED when
the call comes through the CommandAwareRpcDispatcher, but stops when the call is halfway
through its invocation). That is a race condition that I am now dealing with as follows:
1. cacheStatusCheck throws a CacheNotReadyException which is a subclass of
IllegalStateException (and hence backward-compat)
2. The CommandAwareRpcDispatcher wraps the invocation in a try block and if it catches a
CacheNotReadyException (effectively the race condition), it responds with a
RequestIgnoredResponse. This causes the caller to prefer a valid response.
Data gravitation prefers exception response over valid gravitation
------------------------------------------------------------------
Key: JBCACHE-1528
URL:
https://jira.jboss.org/jira/browse/JBCACHE-1528
Project: JBoss Cache
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Buddy Replication
Affects Versions: 3.1.0.GA
Reporter: Brian Stansberry
Assignee: Manik Surtani
Fix For: 3.2.0.GA
A web request that performed a data gravitation for the session failed because one node
returned an ISE while another returned the data. The ISE should have been ignored and the
returned data used.
The first log message below shows what was returned from the gravitation RPC; the second
indicates that the ISE propagated.
[JBoss] 16:48:56,696 TRACE [org.jboss.cache.marshall.CommandAwareRpcDispatcher]
(ajp-jawa04%2F10.34.32.156-8009-7) responses: [sender=10.34.32.154:59373,
retval=GravitateResult dataFound=false nodeData=null fqn=null, received=true,
suspected=false]
[JBoss] [sender=10.34.32.153:40508, retval=GravitateResult dataFound=true
nodeData=[NodeData {fqn: /JSESSION/st_localhost/BrvolmfTMDqZAzEL1quXCA__, attrs={0=192,
1=1249483734634,
2=org.jboss.web.tomcat.service.session.distributedcache.spi.DistributableSessionMetadata@500942cd,
3=org.jboss.ha.framework.server.SimpleCachableMarshalledValue{raw=nullserialized=true}}}]
fqn=/_BUDDY_BACKUP_/10.34.32.155_47742/JSESSION/st_localhost/BrvolmfTMDqZAzEL1quXCA__,
received=true, suspected=false]
[JBoss] [sender=10.34.32.155:47742, retval=java.lang.IllegalStateException: Cache not in
STARTED state!, received=true, suspected=false]
[JBoss]
[JBoss] 16:48:56,698 ERROR [org.apache.catalina.connector.CoyoteAdapter]
(ajp-jawa04%2F10.34.32.156-8009-7) An exception or error occurred in the container during
the request processing
[JBoss] java.lang.IllegalStateException: Cache not in STARTED state!
[JBoss] at
org.jboss.cache.invocation.CacheInvocationDelegate.cacheStatusCheck(CacheInvocationDelegate.java:695)
[JBoss] at
org.jboss.cache.invocation.CacheInvocationDelegate.getChildrenNamesInternal(CacheInvocationDelegate.java:652)
[JBoss] at
org.jboss.cache.invocation.CacheInvocationDelegate.getChildrenNames(CacheInvocationDelegate.java:639)
[JBoss] at
org.jboss.cache.commands.read.GravitateDataCommand.perform(GravitateDataCommand.java:130)
....
The stack trace below is what was returned from the remote node; it's not the
caller-side stack.
--
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