You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Tsz Wo Nicholas Sze (JIRA)" <ji...@apache.org> on 2017/11/03 19:07:00 UTC
[jira] [Commented] (RATIS-125) The cause in a StateMachineException
is not sent to client
[ https://issues.apache.org/jira/browse/RATIS-125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16238186#comment-16238186 ]
Tsz Wo Nicholas Sze commented on RATIS-125:
-------------------------------------------
Below adds a fake exception to RATIS-122 in order to show that the cause is not sent to client.
{code}
+++ b/ratis-examples/src/main/java/org/apache/ratis/examples/filestore/FileStore.java
@@ -118,6 +118,9 @@ public class FileStore implements Closeable {
throw new IOException("The file path " + relative + " resolved to " + full
+ " is not a sub-path under root directory " + root);
}
+ if (relative.startsWith("foo")) {
+ throw new IOException("Fake exception: " + relative);
+ }
return full;
}
+++ b/ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java
@@ -923,6 +923,7 @@ public class RaftServerImpl implements RaftServerProtocol,
// reply as a StateMachineException
final StateMachineException e = new StateMachineException(getId(), exception);
r = new RaftClientReply(clientId, serverId, groupId, callId, false, null, e);
+ LOG.error("Failed client request: " + r, e);
}
// update retry cache
cacheEntry.updateResult(r);
{code}
> The cause in a StateMachineException is not sent to client
> ----------------------------------------------------------
>
> Key: RATIS-125
> URL: https://issues.apache.org/jira/browse/RATIS-125
> Project: Ratis
> Issue Type: Improvement
> Reporter: Tsz Wo Nicholas Sze
>
> StateMachineExceptionProto only has class name, message and stack trace but not the cause.
> In the client side, it cannot see the real cause of the exception.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)