Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISPN-8712 BiasRevocationTest.testFailedRevocationDuringPutAllOnNonOwn… #5692

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -5,8 +5,12 @@
import java.io.ObjectOutput;

import org.infinispan.commands.remote.BaseRpcCommand;
import org.infinispan.commons.CacheException;
import org.infinispan.remoting.transport.ResponseCollectors;
import org.infinispan.util.ByteString;
import org.infinispan.util.concurrent.CommandAckCollector;
import org.infinispan.util.logging.Log;
import org.infinispan.util.logging.LogFactory;

/**
* A command that represents an exception acknowledge sent by any owner.
Expand All @@ -17,6 +21,7 @@
* @since 9.0
*/
public class ExceptionAckCommand extends BaseRpcCommand {
private static final Log log = LogFactory.getLog(ExceptionAckCommand.class);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot about this comment, sorry.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me too, I've checked just tests and merged... let's not worry about that.


public static final byte COMMAND_ID = 42;
private CommandAckCollector commandAckCollector;
Expand All @@ -40,7 +45,8 @@ public ExceptionAckCommand(ByteString cacheName, long id, Throwable throwable, i
}

public void ack() {
commandAckCollector.completeExceptionally(id, throwable, topologyId);
CacheException remoteException = ResponseCollectors.wrapRemoteException(getOrigin(), this.throwable);
commandAckCollector.completeExceptionally(id, remoteException, topologyId);
}

@Override
Expand Down
Expand Up @@ -337,7 +337,10 @@ private void removeFromContextOnRetry(InvocationContext ctx, Collection<?> keys)
}
for (Object key : keys) {
MVCCEntry entry = (MVCCEntry) ctx.lookupEntry(key);
entry.resetCurrentValue();
// When a non-transactional command is retried remotely, the context is going to be empty
if (entry != null) {
entry.resetCurrentValue();
}
}
} else {
ctx.removeLookedUpEntries(keys);
Expand Down
Expand Up @@ -21,7 +21,6 @@
import org.infinispan.factories.annotations.Inject;
import org.infinispan.factories.annotations.Start;
import org.infinispan.interceptors.locking.ClusteringDependentLogic;
import org.infinispan.remoting.RemoteException;
import org.infinispan.remoting.inboundhandler.action.Action;
import org.infinispan.remoting.inboundhandler.action.ActionState;
import org.infinispan.remoting.inboundhandler.action.ActionStatus;
Expand Down Expand Up @@ -235,7 +234,7 @@ private BlockingRunnable createIndirectRpcRunnable(SingleRpcCommand command, int
return new DefaultTopologyRunnable(this, command, Reply.NO_OP, TopologyMode.READY_TX_DATA, commandTopologyId, false) {
@Override
protected void onException(Throwable throwable) {
sendExceptionAck(writeCommand.getCommandInvocationId(), new RemoteException("Exception on " + localAddress, throwable), commandTopologyId);
sendExceptionAck(writeCommand.getCommandInvocationId(), throwable, commandTopologyId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you have any reason to drop the RemoteException wrapping? I probably found useful having the address of exception source at hand...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except for OutdatedTopologyException and AvailabilityException, the wrapping still happens.

}
};
}
Expand Down
Expand Up @@ -16,7 +16,7 @@
public class ResponseCollectors {
private static final Log log = LogFactory.getLog(ResponseCollectors.class);

public static CacheException wrapRemoteException(Address sender, Exception exception) {
public static CacheException wrapRemoteException(Address sender, Throwable exception) {
CacheException e;
if (exception instanceof SuspectException) {
e = log.thirdPartySuspected(sender, (SuspectException) exception);
Expand Down