tkalkirill commented on code in PR #6375:
URL: https://github.com/apache/ignite-3/pull/6375#discussion_r2259624691
##########
modules/network/src/main/java/org/apache/ignite/internal/network/DefaultMessagingService.java:
##########
@@ -486,22 +488,24 @@ private void handleMessageFromNetwork(InNetworkObject
inNetworkObject) {
Long finalCorrelationId = correlationId;
firstHandlerExecutor.execute(() -> {
- long startedNanos = System.nanoTime();
+ long startedNanos = longHandlingLoggingEnabled ? System.nanoTime()
: 0;
try {
handleStartingWithFirstHandler(payload, finalCorrelationId,
inNetworkObject, firstHandlerContext, handlerContexts);
} catch (Throwable e) {
handleAndRethrowIfError(inNetworkObject, e);
} finally {
- long tookMillis =
TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startedNanos);
-
- if (tookMillis > 100 &&
IgniteSystemProperties.getBoolean(LONG_HANDLING_LOGGING_ENABLED, false)) {
- LOG.warn(
- "Processing of {} from {} took {} ms",
- LOG.isDebugEnabled() && includeSensitive() ?
message : message.toStringForLightLogging(),
- inNetworkObject.sender(),
- tookMillis
- );
+ if (longHandlingLoggingEnabled) {
+ long tookMillis =
TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startedNanos);
+
+ if (tookMillis > 100) {
+ LOG.warn(
Review Comment:
I suggest adding a `LOG.isWarnEnabled()` check to make it more optimal and
not call `message.toStringForLightLogging()` unnecessarily.
--
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]