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

Ensure NGINX reload occurs #1033

Merged
merged 7 commits into from
Sep 11, 2023

Conversation

ciarams87
Copy link
Member

@ciarams87 ciarams87 commented Sep 5, 2023

Proposed changes

Problem:
When we reload NGINX, we do not check whether the reload succeeds. We just sleep for a second to wait for the new workers to spin up. We need to verify that a reload was successful and return an error if it fails.

Solution: First check if NGINX accepted the reload by confirming using the /proc filesystem that new workers are being created. Then use a configVersion check to ensure the expected version of the configuration is being served by the workers to confirm the reload was successful.

Testing: Manual testing with successful config and incorrect config, added and updated unit-tests, ensured conformance tests still pass

Closes #664

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

@github-actions github-actions bot added the bug Something isn't working label Sep 5, 2023
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Sep 6, 2023
@ciarams87 ciarams87 changed the title DRAFT: Ensure reload occurs Ensure NGINX reload occurs Sep 6, 2023
@ciarams87 ciarams87 marked this pull request as ready for review September 6, 2023 12:10
@ciarams87 ciarams87 requested a review from a team as a code owner September 6, 2023 12:10
internal/mode/static/nginx/config/version_template.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/runtime/manager.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/runtime/manager.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/runtime/manager.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/runtime/manager.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/runtime/verify.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/runtime/verify.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/config/version_template.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/runtime/verify.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/runtime/verify_test.go Outdated Show resolved Hide resolved
internal/mode/static/handler.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/config/version.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/runtime/manager.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/runtime/manager.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/runtime/manager.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/runtime/verify_test.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/runtime/verify.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/runtime/manager.go Show resolved Hide resolved
internal/mode/static/nginx/runtime/manager.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/runtime/verify.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/runtime/verify_test.go Outdated Show resolved Hide resolved
internal/mode/static/nginx/config/version_test.go Outdated Show resolved Hide resolved
@ciarams87 ciarams87 force-pushed the fix/ensure-reload-happens branch 4 times, most recently from 32c445a to 77434f4 Compare September 11, 2023 09:31
Copy link
Contributor

@kate-osborn kate-osborn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@ciarams87 ciarams87 enabled auto-merge (squash) September 11, 2023 19:28
@ciarams87 ciarams87 merged commit dae5fac into nginxinc:main Sep 11, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Ensure NGINX reload actually happens
5 participants