Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Nginx healthcheck script to tolerate unavailability #365

Merged

Conversation

a-b
Copy link
Member

@a-b a-b commented Dec 27, 2023

  • A short explanation of the proposed change:
    Addresses Healthcheck script exits when nginx is not available resulting deadlock #364 health check will wait and retry if Nginx is not available.

  • An explanation of the use cases your change solves
    This change allows Nginx and webserver to start without monit interruption.

  • I have viewed signed and have submitted the Contributor License Agreement

  • I have made this pull request to the develop branch

  • I have run CF Acceptance Tests on bosh lite

@Gerg
Copy link
Member

Gerg commented Dec 28, 2023

What is special about curl exit code 7? Would this same deadlock behavior not occur for other curl exit codes? It would be helpful to have details about this error case in the commit message.

Also, if we only care about the "Connection Refused" case, would it be more appropriate to use the --retry-connrefused curl flag?

@sethboyles
Copy link
Member

I think there was hesitation to use --retry-connrefused as it was added to curl 7.52.0, and ubuntu-xenial stemcells (apparently) contain curl 7.47.0.

@a-b a-b changed the title Healthcheck script tolerates Nginx availability Make Nginx healthcheck script to tolerate unavailability Dec 29, 2023
Addresses cloudfoundry#364

If Nginx restarts, the healthcheck curl exits with code 7, triggering
another Nginx restart. To avoid this, we need stay in the loop and retry
to allow Nginx to complete the restart.
@a-b a-b force-pushed the 364-healthcheck-ignore-exitcode-7 branch from 170d417 to d045b40 Compare December 29, 2023 20:10
@a-b
Copy link
Member Author

a-b commented Dec 29, 2023

What is special about curl exit code 7? Would this same deadlock behavior not occur for other curl exit codes? It would be helpful to have details about this error case in the commit message.

Updated commit message.
Do you have any particular scenarios for other curl exit codes that you're worried about, @Gerg?

@sethboyles sethboyles merged commit fb33b8a into cloudfoundry:develop Jan 2, 2024
2 checks passed
@a-b a-b deleted the 364-healthcheck-ignore-exitcode-7 branch January 8, 2024 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants