shelltea opened a new issue #6132:
URL: https://github.com/apache/apisix/issues/6132


   ### Issue description
   
   When i use batch-request plugin,And send a request like this:
   ```
   ## 测试batch-requests
   ## 测试batch-requests
   curl -X "POST" "http://api.com/apisix/batch-requests"; \
        -H 'Content-Type: application/json; charset=utf-8' \
        -d $'{
     "timeout": 200,
     "pipeline": [
       {
         "path": "/v2/comments/detail",
         "method": "GET",
         "query": {
           "commentId": "3231329",
           "userId": "108580553",
           "pageNo": "1"
         }
       },
       {
         "path": "/v2/comments/list",
         "method": "GET",
         "query": {
           "pageNo": "1",
           "userId": "108580553",
           "businessId": "101155"
         }
       }
     ]
   }'
   ```
   
   I got this:
   ```
   [
     {
       "body": 
"{\"code\":0,\"message\":\"\",\"data\":{\"totalCount\":0,\"pageNo\":1,\"pageList\":[{\"user\":{\"headUrl\":\"https:\/\/cdn.abc.com\/kstory\/headimgs\/123.png\",\"headType\":null,\"ornamentUrl\":null,\"nickname\":\"乙\",\"nicknameColor\":\"#1B1B1B\",\"listenIcon\":\"\",\"birthdayIcon\":\"\",\"userIdentityIconList\":[],\"router\":null},\"comment\":{\"commentId\":3231329,\"commentTime\":\"2018-03-27\",\"commentType\":1,\"commentText\":\"可能是另一只猴子跟乔治做了,好朋友。\",\"audioUrl\":null,\"audioDuration\":null,\"isPraise\":false,\"praiseCount\":50,\"praiseCountText\":\"50\",\"backgroundStyle\":null,\"childrenCommentCount\":0,\"children\":[]}}],\"hasNext\":false}}",
       "headers": {
         "Connection": "close",
         "Date": "Mon, 17 Jan 2022 10:51:15 GMT",
         "Content-Type": "application\/json",
         "Access-Control-Expose-Headers": "*",
         "Access-Control-Max-Age": "7200",
         "Access-Control-Allow-Methods": "*",
         "Access-Control-Allow-Origin": "*",
         "Transfer-Encoding": "chunked",
         "X-Request-Id": "858335b8-767b-4ca8-85fd-e98c6239b344",
         "Server": "APISIX\/2.10.2",
         "Cache-Control": "private, max-age=0"
       },
       "status": 200,
       "reason": ""
     },
     {
       "reason": "upstream timeout",
       "status": 504
     },
     {}
   ]
   ```
   The first path `/v2/comments/detail` return 200,The second path 
`/v2/comments/list` return 504.
   But when send a request included only second path,return 200 like this:
   ```
   ## 测试batch-requests
   curl -X "POST" "http://api.com/apisix/batch-requests"; \
        -H 'Content-Type: application/json; charset=utf-8' \
        -d $'{
     "timeout": 200,
     "pipeline": [
       {
         "path": "/v2/comments/list",
         "method": "GET",
         "query": {
           "pageNo": "1",
           "userId": "108580553",
           "businessId": "101155"
         }
       }
     ]
   }'
   
   ```
   
   Response:
   ```
   [
     {
       "body": 
"{\"code\":0,\"message\":\"\",\"data\":{\"totalCount\":0,\"pageNo\":1,\"hasNext\":false}}",
       "headers": {
         "Connection": "close",
         "Date": "Mon, 17 Jan 2022 11:00:27 GMT",
         "Content-Type": "application\/json",
         "Access-Control-Expose-Headers": "*",
         "X-Request-Id": "b3e4ff73-337e-4206-9abd-3eb06d1ebc33",
         "Transfer-Encoding": "chunked",
         "Access-Control-Allow-Origin": "*",
         "Server": "APISIX\/2.10.2",
         "Access-Control-Allow-Methods": "*",
         "Cache-Control": "private, max-age=0",
         "Access-Control-Max-Age": "7200"
       },
       "status": 200,
       "reason": ""
     }
   ]
   ```
   
   ### Environment
   
   - apisix version (cmd: `apisix version`):
   - OS (cmd: `uname -a`):
   - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
   - etcd version, if have (cmd: run `curl 
http://127.0.0.1:9090/v1/server_info` to get the info from server-info API):
   - apisix-dashboard version, if have:
   - the plugin runner version, if the issue is about a plugin runner (cmd: 
depended on the kind of runner):
   - luarocks version, if the issue is about installation (cmd: `luarocks 
--version`):
   
   
   ### Steps to reproduce
   
   1. enable batch-request plugin
   2. send request with 2 path
   
   ### Actual result
   
   no
   
   ### Error log
   
   2022/01/17 19:02:57 [error] 47#47: *88331988 [lua] http.lua:885: __index(): 
closed, client: 11.20.19.20, server: _, request: "POST /apisix/batch-requests 
HTTP/1.1", host: "api.com"
   
   ### Expected result
   
   _No response_


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