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

   ### Current Behavior
   
   An upstream configured with 2 targets:
   
   
   {
     "nodes": [
       {
         "host": "172.16.1.115",
         "port": 3000,
         "weight": 1
       },
       {
         "host": "172.16.1.115",
         "port": 3001,
         "weight": 1
       }
     ],
     "timeout": {
       "connect": 6,
       "send": 6,
       "read": 6
     },
     "type": "roundrobin",
     "checks": {
       "active": {
         "concurrency": 10,
         "healthy": {
           "http_statuses": [
             200,
             302
           ],
           "interval": 1,
           "successes": 2
         },
         "http_path": "/",
         "timeout": 1,
         "type": "http",
         "unhealthy": {
           "http_failures": 5,
           "http_statuses": [
             429,
             404,
             500,
             501,
             502,
             503,
             504,
             505
           ],
           "interval": 1,
           "tcp_failures": 2,
           "timeouts": 3
         }
       }
     },
     "scheme": "http",
     "pass_host": "pass",
     "name": "Upstream 1 on port 3000",
     "keepalive_pool": {
       "idle_timeout": 60,
       "requests": 1000,
       "size": 320
     }
   }
   
   The Route:
   
   {
     "uri": "/*",
     "name": "Default Static Route",
     "methods": [
       "GET",
       "POST",
       "PUT",
       "DELETE",
       "PATCH",
       "HEAD",
       "OPTIONS",
       "CONNECT",
       "TRACE",
       "PURGE"
     ],
     "host": "*.local",
     "plugins": {
       
       "proxy-rewrite": {
         "scheme": "https"
       }
     },
     "upstream_id": "447279289499386665",
     "status": 1
   }
   
   Both target nodes are running, very simple express nodejs app for testing.
   
   Requesting / from apisix, works fine and healthcheck returns all ok:
   
   root@apisix1:/usr/local/apisix/logs# curl 
http://172.16.1.110:9090/v1/healthcheck
   
[{"healthy_nodes":[{"priority":0,"weight":1,"host":"172.16.1.115","port":3000}],"src_type":"upstreams","name":"upstream#\/apisix\/upstreams\/447279289499386665","src_id":"447279289499386665","nodes":[{"priority":0,"weight":1,"host":"172.16.1.115","port":3000},{"priority":0,"weight":1,"host":"172.16.1.115","port":3001}]}]
   
   If i stop the first node, healthcheck shows only the second node as healthy, 
and as expected, Apisix logs show:
   
   2023/02/11 17:28:52 [warn] 2876#2876: *22420 [lua] healthcheck.lua:1149: 
log(): [healthcheck] (upstream#/apisix/upstreams/447279289499386665) unhealthy 
TCP increment (2/2) for '(172.16.1.115:3000)' while connecting to upstream, 
client: 192.168.34.171, server: _, request: "GET / HTTP/1.1", upstream: 
"http://172.16.1.115:3000/";, host: "www.local"
   
   However, if I bring the second node online, it is never added back to the 
load balancing rotation.
   
   It receives health check requests, it is never added back.
   
   If I stop the second node and do an HTTP Request to Apisix, i get a 502 Bad 
Gateway, and the second requests goes to the first target node, which is then 
added to the healthcheck correctly.
   
   Bringing back the second node, will automatically add it to healthy nodes 
and it will receive requests.
   
   
   
   ### Expected Behavior
   
   A target node that has been brought back up, should be added automatically 
back into the load balancing RR
   
   ### Error Logs
   
   _No response_
   
   ### Steps to Reproduce
   
   As described above
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.0.0
   - Operating system (run `uname -a`): Debian 11
   - 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`):3.5.7
   


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