You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/12/08 10:03:19 UTC

[GitHub] [apisix] membphis edited a comment on issue #2950: bug: Admin API concurrently created Router ID duplicate

membphis edited a comment on issue #2950:
URL: https://github.com/apache/apisix/issues/2950#issuecomment-740518850


   @spacewander I use this script reproduce this issue. It seems to be a bug of APISIX. please take a look at this issue
   
   ```py
   $ cat test.py
   #!/usr/bin/env python
   # -*- coding: utf-8 -*-
   import grequests
   
   #并发设置route
   payloads = {}
   for id in range(100):
       payload = {
                   "uri": "/test_%s"%id,
                   "upstream": {
                       "type": "roundrobin",
                       "nodes": {
                           "127.0.0.1:7000": 1
                       }
                   }
       }
       payloads[id]=payload
   unsent_request = []
   header = {"X-API-KEY":"edd1c9f034335f136f87ad84b625c8f1"}
   for id in payloads:
       print(id)
       unsent_request.append(grequests.post("http://127.0.0.1:9080/apisix/admin/routes/" ,json=payloads[id], headers = header))
       responses = grequests.map(unsent_request) 
   for response in responses:
       print(response.content)
       response.close()
   ```
   
   Same UUID:
   
   ![image](https://user-images.githubusercontent.com/6814606/101469231-71ee3b00-397f-11eb-8208-7717a5525354.png)
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org