-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
chore: move events sock path to conf #10732
Conversation
The errors in the test is the result of the behavior in test::nginx that cleans up the conf directory, which looks like this:
In fact, this was already present when we were still using the conf server (config_listen.sock will be in There are several ways to fix it:
This PR itself mentions issues that we should be wary of, including but not limited to files being exposed by container mounts and not being cleaned up on abnormal exits resulting in failure to start next time. Waiting for discussion. cc @monkeyDluffy6017 @shreemaan-abhishek Ref: |
But your changes don't introduce these problems, do they? What I am trying to say is, this problem can arise anytime even without your PR being merged. I think, introducing a configuration variable is fair. |
IMHO, i prefer option 3 |
In fact, I've implemented the third point mentioned (create a The test::nginx makes some pretty dirty assumptions, it completely disregards any directories (conf, logs, html, etc) that may exist under the servroot other than the ones it confirms exist, and therefore its cleanup doesn't work properly. https://github.com/openresty/test-nginx/blob/40aa6364b0a428779cbf96cd10f49b20166483ee/lib/Test/Nginx/Util.pm#L867-L891 And the test::nginx will only do special things to paths like Instead it tries again to delete and recreate the servroot folder before the start of each test case, and there are no hooks available there for early cleanup files. So I have tested the cleanup added via Therefore the use of special cases in testing is indispensable (in my perception). For example, use an environment variable to overwrite the directory used for testing. Is there a better way to do this? |
LGTM |
@bzp2010 did you attempt using other solution? IMHO, at this stage since solution 3 is not available you can choose any solution and give us a fix. |
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the [email protected] list. Thank you for your contributions. |
This pull request/issue has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time. |
we may mount the logs folder to an external volume ==> |
Description
In my last PR #10550, I place the unix socket files in
logs
directory. It may be inappropriate because if we use a container environment with log-rotate turned on, we may mount thelogs
folder to an external volume, and I think we may run into communication and permissions issues.So this PR moves the sock files to the conf folder, which is probably a better choice because that's where we're generating our nginx.conf right now, and the same way we used to create conf_server sock file there previously.
In addition, this PR adds some code for cleaning up the sock file to ensure that when an Nginx process crashes or is killed, the sock file can be cleaned up before the next startup, preventing such errors (this is because the file already exists):
This often occurs when using containers, and we have to be able to handle it correctly.
This feature has not yet been released, so fixing it now is timely and involves no compatibility issues. In the meantime, no test cases themselves need to be changed.
Checklist