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


##########
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:
   > Unless we wanted to schedule another callback
   
   We might in the future.  From the implementation perspective it may seem 
like we have "the request" and "the callback", but conceptually we should think 
in terms of a request that may run a few asynchronous operations and then 
continue processing, in which case we can have multiple callbacks in the 
context of the same request.  So logically it's like this:
   
   -- request starts processing
   1. Do some processing on a broker request thread
   2. Do async operation (RPC, or maybe even async storage access in some 
distant future)
   3. Continue processing on a broker request thread.
   4. Do some async operation
   5. Continue processing on a broker request thread
   6. Do some async operation
   7. Finish processing on a broker request thread
   
   -- request is done
   
   In this case the steps 1, 3, 5, 7 would be accounted as local time and 
logically we just keep processing the same request, only instead of blocking 
the thread in steps 2, 4, 6, we wait without blocking the thread.



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