OmniaGM commented on code in PR #15279: URL: https://github.com/apache/kafka/pull/15279#discussion_r1473036431
########## core/src/main/scala/kafka/network/RequestChannel.scala: ########## @@ -92,18 +92,18 @@ object RequestChannel extends Logging { val envelope: Option[RequestChannel.Request] = None) extends BaseRequest { // These need to be volatile because the readers are in the network thread and the writers are in the request // handler threads or the purgatory threads - @volatile var requestDequeueTimeNanos = -1L - @volatile var apiLocalCompleteTimeNanos = -1L - @volatile var responseCompleteTimeNanos = -1L - @volatile var responseDequeueTimeNanos = -1L - @volatile var messageConversionsTimeNanos = 0L - @volatile var apiThrottleTimeMs = 0L - @volatile var temporaryMemoryBytes = 0L + @volatile var requestDequeueTimeNanos: Long = -1L + @volatile var apiLocalCompleteTimeNanos: Long = -1L + @volatile var responseCompleteTimeNanos: Long = -1L + @volatile var responseDequeueTimeNanos: Long = -1L + @volatile var messageConversionsTimeNanos: Long = 0L + @volatile var apiThrottleTimeMs: Long = 0L + @volatile var temporaryMemoryBytes: Long = 0L @volatile var recordNetworkThreadTimeCallback: Option[Long => Unit] = None @volatile var callbackRequestDequeueTimeNanos: Option[Long] = None @volatile var callbackRequestCompleteTimeNanos: Option[Long] = None - val session = Session(context.principal, context.clientAddress) + val session: Session = Session(context.principal, context.clientAddress) Review Comment: I see sometimes we add the type for `val` and `var` definition and sometimes we don't am just curious what is the pattern we are opting in for here? -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org