gengliangwang commented on code in PR #46980:
URL: https://github.com/apache/spark/pull/46980#discussion_r1639060943
##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/planner/SparkConnectStreamingQueryListenerHandler.scala:
##########
@@ -83,20 +83,27 @@ class
SparkConnectStreamingQueryListenerHandler(executeHolder: ExecuteHolder) ex
} catch {
case NonFatal(e) =>
logError(
- s"[SessionId: $sessionId][UserId: $userId][operationId: " +
- s"${executeHolder.operationId}] Error sending listener
added response.",
+ log"[SessionId: ${MDC(LogKeys.SESSION_ID, sessionId)}]" +
+ log"[UserId: ${MDC(LogKeys.USER_ID, userId)}]" +
+ log"[operationId: ${MDC(LogKeys.OPERATION_HANDLE_IDENTIFIER,
+ executeHolder.operationId)}] " +
+ log"Error sending listener added response.",
e)
listenerHolder.cleanUp()
return
}
}
- logInfo(s"[SessionId: $sessionId][UserId: $userId][operationId: " +
- s"${executeHolder.operationId}] Server side listener added. Now
blocking until " +
- "all client side listeners are removed or there is error
transmitting the event back.")
+ logInfo(log"[SessionId: ${MDC(LogKeys.SESSION_ID, sessionId)}][UserId:
" +
+ log"${MDC(LogKeys.USER_ID, userId)}][operationId: " +
+ log"${MDC(LogKeys.OPERATION_HANDLE_IDENTIFIER,
executeHolder.operationId)}] " +
+ log"Server side listener added. Now blocking until all client side
listeners are " +
+ log"removed or there is error transmitting the event back.")
// Block the handling thread, and have serverListener continuously
send back new events
listenerHolder.streamingQueryListenerLatch.await()
- logInfo(s"[SessionId: $sessionId][UserId: $userId][operationId: " +
- s"${executeHolder.operationId}] Server side listener long-running
handling thread ended.")
+ logInfo(log"[SessionId: ${MDC(LogKeys.SESSION_ID, sessionId)}][UserId:
" +
+ log"${MDC(LogKeys.USER_ID, userId)}]" +
+ log"[operationId: ${MDC(LogKeys.OPERATION_HANDLE,
executeHolder.operationId)}] " +
Review Comment:
OPERATION_ID
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]