artemlivshits commented on code in PR #13391:
URL: https://github.com/apache/kafka/pull/13391#discussion_r1160892559


##########
core/src/main/scala/kafka/server/KafkaRequestHandler.scala:
##########
@@ -69,10 +108,23 @@ class KafkaRequestHandler(id: Int,
           completeShutdown()
           return
 
+        case request: RequestChannel.CallbackRequest =>
+          try {
+            request.originalRequest.callbackRequestDequeTimeNanos = 
Some(time.nanoseconds())

Review Comment:
   Yeah, if we need to make larger change to complete the framework, then we 
should definitely do in a follow-up change, but I think in this case all we 
need to do is this:
   ```
     val prevCallbacksTimeNanos = 
originalRequest.callbackRequestCompleteTimeNanos.getOrElse(0) - 
originalRequest.callbackRequestDequeTimeNanos.getOrElse(0)
     originalRequest.callbackRequestCompleteTimeNanos = None
   
     originalRequest.callbackRequestDequeTimeNanos = Some(time.nanoseconds() - 
prevCallbacksTimeNanos)
     currentRequest.set(callback.originalRequest)
   ```
   and then we've got ourselves a fully functional framework for supporting 
arbitrary number of async calls in a request processing :-).



-- 
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

Reply via email to