spacewander commented on a change in pull request #4835:
URL: https://github.com/apache/apisix/pull/4835#discussion_r690871518



##########
File path: apisix/plugins/ext-plugin/init.lua
##########
@@ -400,9 +442,26 @@ local rpc_handlers = {
             return nil, "failed to send RPC_HTTP_REQ_CALL: " .. err
         end
 
-        local ty, resp = receive(sock)
-        if ty == nil then
-            return nil, "failed to receive RPC_HTTP_REQ_CALL: " .. resp
+        local ty, resp
+        while true do
+            ty, resp = receive(sock)
+            if ty == nil then
+                return nil, "failed to receive RPC_HTTP_REQ_CALL: " .. resp
+            end
+
+            if ty ~= constants.RPC_EXTRA_INFO then
+                break
+            end
+
+            local out, err = handle_extra_info(ctx, resp)
+            if not out then
+                return nil, "failed to handle RPC_EXTRA_INFO: " .. err
+            end
+
+            local ok, err = send(sock, constants.RPC_EXTRA_INFO, out)
+            if not ok then
+                return nil, "failed to reply RPC_EXTRA_INFO: " .. err
+            end
         end

Review comment:
       The detail can be found in 
https://lists.apache.org/thread.html/r03232d5a48ba1d71c1b62185894265348abbf3bede13fba7edd38255%40%3Cdev.apisix.apache.org%3E.
   
   Quoted from there:
   ```
   APISIX sends HTTPReqCallReq
   while reply from Runner isn't HTTPReqCallResp:
       APISIX handle ExtraInfoReq
       APISIX sends ExtraInfoResp
   APISIX handle HTTPReqCallResp
   ```




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


Reply via email to