[
https://issues.apache.org/jira/browse/RATIS-222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16447224#comment-16447224
]
Elek, Marton commented on RATIS-222:
------------------------------------
Thanks [~VinayBanakar] to work on this issue. I tested the current behaviour
and in case of an undefined variable I got an error in the log:
{code}
2018-04-22 12:20:13 DEBUG RaftClient:354 - client-22F4B2566FF9: suggested new
leader: null. Failed RaftClientRequest(client-22F4B2566FF9->n2) in
group-6F7570313233, cid=0, seq=0 RO, Message:qwe with java.io.IOException:
java.lang.IllegalStateException: Undefined variable "qwe"
{code}
It's not exactly clear what you would like to achieve (I expect an ERROR level
message and immediate stop instead of retry).
But anyway, I would not add en example specific message parsing to the
RatisClientImpl. Ideally RatisClient should be generic and shouldn't contain
any implementation specific part.
I think the main problem here is that the client got an IOException instead of
StateMachineException. I think it's an error in the
ArithmeticStateMachine.applyTransaction. Ideally it should return with a
CompletableFuture which includes the "business" exception
(IllegalStateException in our case). Currently that's not the case and raft
server will handle it as an internal exception not as an exception in the state
matchine.
> Handle Error exception when Unassigned Variable is tried to get .
> ------------------------------------------------------------------
>
> Key: RATIS-222
> URL: https://issues.apache.org/jira/browse/RATIS-222
> Project: Ratis
> Issue Type: Bug
> Affects Versions: 0.1.0-alpha
> Reporter: Vinay Banakar
> Assignee: Vinay Banakar
> Priority: Major
> Labels: easyfix
> Fix For: 0.2.0-alpha
>
> Attachments: r222_20180415a.patch
>
>
> Today, In Arithmetic-Example
> ./client.sh get –name “Unassigned variable”
> Exception handle and display for user.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)