Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-2535

Default health check response readiness should not be 200

    Details

    • Steps to Reproduce:
      Hide

      Use `io.smallrye.health.emptyChecksOutcome=DOWN` or negative health check and add a watch on :8080/health during the start of the container.

      Show
      Use `io.smallrye.health.emptyChecksOutcome=DOWN` or negative health check and add a watch on :8080/health during the start of the container.

      Description

      Originally reported in https://github.com/smallrye/smallrye-health/issues/84. The default health check response is hardcoded in [1] which may produce wrong results with regards to the mentioned emptyChecksResults and default readiness probe queries (the default readiness probe response (before actual users checks kick in) is UP which is wrong). For instance:

      http: error: ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /health (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5a5ac846d0>: Failed to establish a new connection: [Errno 111] Connection refused')) while doing POST request to URL: http://localhost:8080/health
      
      http: error: ConnectionError: HTTPConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /health (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fca7d4b9650>: Failed to establish a new connection: [Errno 111] Connection refused')) while doing POST request to URL: http://localhost:8080/health
      
      HTTP/1.1 200 OK
      Date: Sun, 01 Mar 2020 08:28:22 GMT
      
      {
          "checks": [],
          "status": "UP"
      }
      
      HTTP/1.1 200 OK
      Date: Sun, 01 Mar 2020 08:28:22 GMT
      
      {
          "checks": [],
          "status": "UP"
      }
      
      HTTP/1.1 200 OK
      Date: Sun, 01 Mar 2020 08:28:23 GMT
      
      {
          "checks": [],
          "status": "UP"
      }
      
      HTTP/1.1 503 Service Unavailable
      Date: Sun, 01 Mar 2020 08:28:23 GMT
      
      {
          "checks": [
              {
                  "name": "NotReadyCheck",
                  "status": "DOWN"
              }
          ],
          "status": "DOWN"
      }
      

      I think we should not respond when there is no SmallRyeHealthReporter actually returning response so we should remove the default hardcoded value.

      [1] https://github.com/thorntail/thorntail/blob/master/fractions/microprofile/microprofile-health/src/main/java/org/wildfly/swarm/microprofile/health/runtime/HttpContexts.java#L124

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mstefank Martin Stefanko
                Reporter:
                mstefank Martin Stefanko
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: