#51248 Ticket 51247 - Container Healthcheck failure
Closed 2 years ago by spichugi. Opened 2 years ago by firstyear.
firstyear/389-ds-base 51247-container-healthfix  into  master

file modified
+7 -5
@@ -330,6 +330,9 @@ 

      healthy = False

      max_failure_count = 20

      for i in range(0, max_failure_count):

+         if ds_proc is None:

+             log.warning("ns-slapd pid has disappeared ...")

+             break

          (check_again, healthy) = begin_healthcheck(ds_proc)

          if check_again is False:

              break
@@ -355,10 +358,9 @@ 

  

  

  def begin_healthcheck(ds_proc):

-     if ds_proc is None:

-         log.warning("ns-slapd pid has disappeared ...")

-         return (False, False)

-     if ds_proc.poll() is not None:

+     # We skip the pid check if ds_proc is none because that means it's coming from the

+     # container healthcheck.

+     if ds_proc is not None and ds_proc.poll() is not None:

          # Ruh-Roh

          log.warning("ns-slapd pid has completed, you should check the error log ...")

          return (False, False)
@@ -425,7 +427,7 @@ 

      if args.runit:

          begin_magic()

      elif args.healthcheck:

-         if begin_healthcheck() is True:

+         if begin_healthcheck(None) is (False, True):

              sys.exit(0)

          else:

              sys.exit(1)

Bug Description: Due to human error, a change to begin_healthcheck
was overlooked that causes containers to always report an unhealthy
state.

Fix Description: Fix the use of begin_healthcheck

fixes #51247

Author: William Brown william@blackhats.net.au

Review by: ???

Pull-Request has been merged by firstyear

2 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/4301

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

2 years ago
Metadata