MINOR: Only update a request's local complete time in API handler if unset
Reviewers: Jason Gustafson
@@ -178,6 +178,8 @@ class KafkaApis(val requestChannel: RequestChannel,
case e: FatalExitError => throw e
case e: Throwable => handleError(request, e)
} finally {
+ // The local completion time may be set while processing the request. Only record it if it's unset.
+ if (request.apiLocalCompleteTimeNanos < 0)
request.apiLocalCompleteTimeNanos = time.nanoseconds
}
}
