Good evening everyone,
I am creating a docker container healthcheck. Such a healthcheck is any application that can run inside the container a test and exit with 0 if everything is ok or exit with any positive number if healthcheck is not ok. This result is noted by docker to know the health of the container. I have done it and it works when the WebApp I want to check is not running (it exits with a positive number) and when it is running (it exits with 0). The problem arises when I want to break functionality in my webapp intentionally to check the healthcheck.
I tried with creating a handler that assigns to an int variable the division 1/0 but nothing changed (not even the handler broke). Healthcheck is 0. Then I assigned to an int variable the division "nikos"/0. This created an exception when running but when I checked the healthcheck by calling the healthcheck handler in the webapp it still reports that it gets a correct response. Healthcheck is again 0. What is happening here? If the code in one handler breaks the rest of the app is left untouched?
I am creating a docker container healthcheck. Such a healthcheck is any application that can run inside the container a test and exit with 0 if everything is ok or exit with any positive number if healthcheck is not ok. This result is noted by docker to know the health of the container. I have done it and it works when the WebApp I want to check is not running (it exits with a positive number) and when it is running (it exits with 0). The problem arises when I want to break functionality in my webapp intentionally to check the healthcheck.
I tried with creating a handler that assigns to an int variable the division 1/0 but nothing changed (not even the handler broke). Healthcheck is 0. Then I assigned to an int variable the division "nikos"/0. This created an exception when running but when I checked the healthcheck by calling the healthcheck handler in the webapp it still reports that it gets a correct response. Healthcheck is again 0. What is happening here? If the code in one handler breaks the rest of the app is left untouched?
Last edited: