Vladislav Pyatkov created IGNITE-22597:
------------------------------------------

             Summary: Exception trace id is not propagated from RAFT listener
                 Key: IGNITE-22597
                 URL: https://issues.apache.org/jira/browse/IGNITE-22597
             Project: Ignite
          Issue Type: Bug
            Reporter: Vladislav Pyatkov
         Attachments: error_log.txt

h3. Motivation
The trace id is generated at the place where the original exception was created 
and should be propogated to other derevatives. Right now, we send only an 
exception message and class name to the RAFT listener response.
{code:java}
private void sendSMError(RpcContext ctx, Throwable th, boolean compacted) {
    RpcRequests.SMErrorResponse resp = factory.sMErrorResponse()
        .error(compacted ? new SMCompactedThrowable(th) : new 
SMFullThrowable(th))
        .build();

    ctx.sendResponse(resp);

    LOG.info("Error occurred on a user's state machine", th);
}
{code}
Hence, we cannot restore the trace id and create an exception with a new trace 
id:
{code:java}
Throwable restoredTh = (Throwable) 
Class.forName(compactedThrowable.throwableClassName())
        .getConstructor(String.class)
        .newInstance(compactedThrowable.throwableMessage());

fut.completeExceptionally(restoredTh);
{code}

h3 Definition of done
* Both attached logs should be logged with the same trace id.
* Massage in the RAFT listener should be logged in error (or warning) level.




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to