[
http://jira.jboss.com/jira/browse/JBCACHE-1123?page=comments#action_12368077 ]
Vladimir Blagojevic commented on JBCACHE-1123:
----------------------------------------------
Good catch!
This will happen, if I am correct, only in byte array based transfer. So for byte array
based transfer we have to do something like:
try
{
ExposedByteArrayOutputStream baos = new ExposedByteArrayOutputStream(16 *
1024);
out = new MarshalledValueOutputStream(baos);
getStateTransferManager().getState(out, Fqn.fromString(sourceRoot),
configuration.getStateRetrievalTimeout(), true, true);
}
catch (Throwable t)
{
stateProducingFailed(t);
}
finally
{
result = baos.getRawBuffer();
Util.close(out);
}
return result;
Is this what you had in mind Brian?
Non-streaming state transfer failures not properly handled
----------------------------------------------------------
Key: JBCACHE-1123
URL:
http://jira.jboss.com/jira/browse/JBCACHE-1123
Project: JBoss Cache
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Clustering
Affects Versions: 2.0.0.CR3
Reporter: Brian Stansberry
Assigned To: Vladimir Blagojevic
Fix For: 2.0.0.CR4
I'm noticing spurious WARN messages in the logs from JGroups when caches do partial
state transfers and the cache being requested doesn't have the target node available:
WARN [org.jgroups.protocols.pbcast.STATE_TRANSFER] state received from
192.168.1.164:4655 is null, will return null state to application
Looking at the JBC state transfer code, particularly
StateTransferManager.getState(ObjectOutputStream out, Fqn fqn, long timeout, boolean
force, boolean suppressErrors), the apparent intent is for a boolean 'false' and a
CacheException to be written to the stream, serialized, and returned to the requestor. The
CacheException is also thrown.
This is breaking in CacheImpl.MessageListenerAdaptor.getState() and getState(String):
try
{
ExposedByteArrayOutputStream baos = new ExposedByteArrayOutputStream(16 *
1024);
out = new MarshalledValueOutputStream(baos);
getStateTransferManager().getState(out, Fqn.fromString(sourceRoot),
configuration.getStateRetrievalTimeout(), true, true);
result = baos.getRawBuffer();
}
catch (Throwable t)
{
stateProducingFailed(t);
}
finally
{
Util.close(out);
}
return result;
The CacheException is thrown from StateTransferManager.getState(). Therefore
"result = baos.getRawBuffer();" is never invoked. Therefore the returned state
is null, leading to the WARN on the recipient. This seems contrary to the intent to
propagate the boolean + exception to the recipient.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira