You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org> on 2023/03/07 13:52:45 UTC

[GitHub] [apisix] monkeyDluffy6017 opened a new issue, #9030: bug: health checker will be recreated every request when use domain name as upstream node

monkeyDluffy6017 opened a new issue, #9030:
URL: https://github.com/apache/apisix/issues/9030

   ### Current Behavior
   
   1. create an upstream
   ```
   curl http://127.0.0.1:9180/apisix/admin/upstreams/1  \
   -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -i -X PUT -d '
   {
       "type":"roundrobin",
       "nodes":[
       {
               "host":"httpbin.org",
               "port":80,
               "weight":1
        },
       {
               "host":"ifconfig.io",
               "port":80,
               "weight":1
        }
       ],
          "checks": {
               "active": {
                   "timeout": 5,
                   "http_path": "/status",
                   "host": "foo.com",
                   "healthy": {
                       "interval": 2,
                       "successes": 1
                   },
                   "unhealthy": {
                       "interval": 1,
                       "http_failures": 2
                   }
               }
           }    
   }'
   ```
   
   2. create a route
   ```
   curl http://127.0.0.1:9180/apisix/admin/routes/1 \
   -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
   
       "uri": "/*",
       "upstream_id": 1
   
   }'
   ```
   
   3. add a log
   ![image](https://user-images.githubusercontent.com/9354193/223439805-7d15b6b6-ecc4-4abd-9ae0-06077e5cc67e.png)
   
   4. send requests
   We can see that a random IP is returned each time
   ![image](https://user-images.githubusercontent.com/9354193/223440161-c2e27305-acee-41fc-8a1b-246658a6754f.png)
   
   5. it will create a new upstream every request
   ![image](https://user-images.githubusercontent.com/9354193/223441462-0de9df3e-a22f-43c9-85d3-36d4740402d4.png)
   https://github.com/apache/apisix/blob/master/apisix/utils/upstream.lua#L98
   
   6. it will create a health checker every request
   ![image](https://user-images.githubusercontent.com/9354193/223441824-8da455b0-24aa-435e-ad0a-b1343c72c41c.png)
   
   
   
   
   
   
   
   ### Expected Behavior
   
   It should not create a health check every request
   
   ### Error Logs
   
   no
   
   ### Steps to Reproduce
   
   It is described above
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.1.0
   - Operating system (run `uname -a`): ubuntu 22.04
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): 1.21.4.1
   - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
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: notifications-unsubscribe@apisix.apache.org.apache.org

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


[GitHub] [apisix] kingluo commented on issue #9030: bug: health checker will be recreated every request when use domain name as upstream node

Posted by "kingluo (via GitHub)" <gi...@apache.org>.
kingluo commented on issue #9030:
URL: https://github.com/apache/apisix/issues/9030#issuecomment-1458460548

   @monkeyDluffy6017 No, the issue I reported previously is the same thing, due to DNS resolution. My issue is when DNS resolution changes, a new upstream parent and new checker are created, and the side effect is the old checker will be leaked. It has nothing to do with a deep copy, which is just a trivial implementation detail. The solution to my issue is not creating a new checker for each new cloned upstream, instead, there must be only one checker for the original parent (route/service/upstream) at any time. After all, the checker does not care about whether the node uses a domain name or IP address.


-- 
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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix] kingluo commented on issue #9030: bug: health checker will be recreated every request when use domain name as upstream node

Posted by "kingluo (via GitHub)" <gi...@apache.org>.
kingluo commented on issue #9030:
URL: https://github.com/apache/apisix/issues/9030#issuecomment-1458249827

   @monkeyDluffy6017 new upstream is created once per new DNS resolution, not triggered by every request. duplicated with #8932


-- 
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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix] monkeyDluffy6017 commented on issue #9030: bug: health checker will be recreated every request when use domain name as upstream node

Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on issue #9030:
URL: https://github.com/apache/apisix/issues/9030#issuecomment-1459238065

   OK, it's the same reason, not only will a new checker be created every time, but the checker cannot be cleared


-- 
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: notifications-unsubscribe@apisix.apache.org

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


Re: [I] bug: health checker will be recreated every request when use domain name as upstream node [apisix]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #9030: bug: health checker will be recreated every request when use domain name as upstream node
URL: https://github.com/apache/apisix/issues/9030


-- 
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: notifications-unsubscribe@apisix.apache.org

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


[GitHub] [apisix] monkeyDluffy6017 commented on issue #9030: bug: health checker will be recreated every request when use domain name as upstream node

Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on issue #9030:
URL: https://github.com/apache/apisix/issues/9030#issuecomment-1458419961

   It's not exactly the same, my problem is caused by the fact that the DNS resolution is different every time, even without deepcopy, because the IP of the upstream has changed, you still need to recreate the checker, you will have the same problem @kingluo 


-- 
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: notifications-unsubscribe@apisix.apache.org

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


Re: [I] bug: health checker will be recreated every request when use domain name as upstream node [apisix]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #9030:
URL: https://github.com/apache/apisix/issues/9030#issuecomment-1956296029

   This issue has been marked as stale due to 350 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.


-- 
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: notifications-unsubscribe@apisix.apache.org

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


Re: [I] bug: health checker will be recreated every request when use domain name as upstream node [apisix]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #9030:
URL: https://github.com/apache/apisix/issues/9030#issuecomment-1980506826

   This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time.


-- 
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: notifications-unsubscribe@apisix.apache.org

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