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/11/14 15:22:15 UTC

[GitHub] [apisix] membphis edited a comment on issue #2745: bug: enabled active health checks, error.log has extra content.

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


   Here is my steps, I got the same wrong result, so I think this issue is a bug:
   
   ```shell
   # set route with healthcheck(host is foo.com)
   curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "uri": "/hello",
       "upstream": {
            "nodes": {
               "127.0.0.1:1980": 1,
               "127.0.0.2:1981": 1
           },
           "type": "roundrobin",
           "checks": {
               "active": {
                   "timeout": 5,
                   "http_path": "/404.html",
                   "host": "foo.com",
                   "healthy": {
                       "interval": 1,
                       "successes": 2
                   },
                   "unhealthy": {
                       "interval": 1,
                       "http_failures": 2
                   }
               }
           }
       }
   }'
   
   # call the API
   curl http://127.0.0.1:9080/hello
   
   # set a new route with healthcheck(host: xxxx.com)
   curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   {
       "uri": "/hello",
       "upstream": {
            "nodes": {
               "127.0.0.1:1980": 1,
               "127.0.0.2:1981": 1
           },
           "type": "roundrobin",
           "retries": 2,
           "checks": {
               "active": {
                   "timeout": 5,
                   "http_path": "/404.html",
                   "host": "xxxx.com",
                   "healthy": {
                       "interval": 1,
                       "successes": 2
                   },
                   "unhealthy": {
                       "interval": 1,
                       "http_failures": 2
                   }
               }
           }
       }
   }'
   
   # call the API again
   curl http://127.0.0.1:9080/hello
   
   # then shutdown the upstream server, check the error log
   kill your-upstream-pid
   
   ```
   
   At the end, we can get the error log:
   
   ![image](https://user-images.githubusercontent.com/6814606/99150496-f70f6880-26cf-11eb-80d7-ea7f25f9cb8c.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