You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Nanda kumar (JIRA)" <ji...@apache.org> on 2019/06/28 14:00: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=16874941#comment-16874941 ] 

Nanda kumar commented on RATIS-125:
-----------------------------------

Client side exception trace with [^RATIS-125.000.patch]
{noformat}
org.apache.ratis.protocol.StateMachineException: java.util.concurrent.CompletionException from Server s1.

Caused by: java.util.concurrent.CompletionException: java.io.IOException: Failed create(foo, false) @s1:1
	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:292)
	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:308)
	at java.util.concurrent.CompletableFuture.biApply(CompletableFuture.java:1088)
	at java.util.concurrent.CompletableFuture$BiApply.tryFire(CompletableFuture.java:1070)
	at java.util.concurrent.CompletableFuture.biApplyStage(CompletableFuture.java:1123)
	at java.util.concurrent.CompletableFuture.thenCombineAsync(CompletableFuture.java:2037)
	at org.apache.ratis.examples.filestore.FileInfo$UnderConstruction.submitCommit(FileInfo.java:305)
	at org.apache.ratis.examples.filestore.FileStore.submitCommit(FileStore.java:185)
	at org.apache.ratis.examples.filestore.FileStoreStateMachine.writeCommit(FileStoreStateMachine.java:190)
	at org.apache.ratis.examples.filestore.FileStoreStateMachine.applyTransaction(FileStoreStateMachine.java:176)
	at org.apache.ratis.server.impl.RaftServerImpl.applyLogToStateMachine(RaftServerImpl.java:1274)
	at org.apache.ratis.server.impl.StateMachineUpdater.applyLog(StateMachineUpdater.java:210)
	at org.apache.ratis.server.impl.StateMachineUpdater.run(StateMachineUpdater.java:144)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: Failed create(foo, false) @s1:1
	at org.apache.ratis.examples.filestore.FileInfo$UnderConstruction.lambda$submitWrite$4(FileInfo.java:220)
	at org.apache.ratis.util.TaskQueue.lambda$submit$0(TaskQueue.java:112)
	at org.apache.ratis.util.LogUtils.runAndLog(LogUtils.java:50)
	at org.apache.ratis.util.LogUtils$1.run(LogUtils.java:91)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	... 1 more
Caused by: java.io.IOException: Fake exception: foo
	at org.apache.ratis.examples.filestore.FileStore.resolve(FileStore.java:131)
	at org.apache.ratis.examples.filestore.FileInfo$UnderConstruction.lambda$submitCreate$1(FileInfo.java:199)
	at org.apache.ratis.util.LogUtils.supplyAndLog(LogUtils.java:70)
	at org.apache.ratis.util.LogUtils$3.get(LogUtils.java:120)
	at org.apache.ratis.util.TaskQueue.lambda$submit$0(TaskQueue.java:110)
	... 7 more
{noformat}

 

> 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
>          Components: proto
>            Reporter: Tsz Wo Nicholas Sze
>            Assignee: Nanda kumar
>            Priority: Major
>         Attachments: RATIS-125.000.patch
>
>
> 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
(v7.6.3#76005)