-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Support configuration reloads for logging #6720
Conversation
It should be noted that several different approaches were considered, and this was by far the simplest. For completeness:
|
@@ -97,6 +97,7 @@ | |||
"d3": "3.5.6", | |||
"elasticsearch": "10.1.2", | |||
"elasticsearch-browser": "10.1.2", | |||
"even-better": "7.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol ❤️
made some notes, but looks good otherwise! |
696e459
to
27cb919
Compare
27cb919
to
b7dbfb9
Compare
@spalger Are you still reviewing this or should I assign somebody else now that you've betrayed us? |
@bevacqua haha, yes. |
Implementation looks great. Can you get write a couple high-level tests for this? I'm thinking it should probably use child processes which actually write to files and rotate from one file to another. |
Added a test case for this. Let me know if there's an alternative that's better than waiting for a fixed amount of seconds. |
server: | ||
port: 8274 | ||
logging: | ||
dest: src/cli/serve/__tests__/logs/first.log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you set the cwd
of the process you can move this into code (where it will be easier to keep up to date)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wat? Not sure how the cwd
changes this at all, but I'm removing the log to file config in favor of what you mention in the next comment
jenkins, test it |
@spalger Wrote a more precise test case |
@spalger Test is now fixed |
LGTM |
@rashidkpc Maybe you want to give it the second pass? |
This looks good, but I hit an issue that I've previously only seen in dev mode. Usually, if you save changes often, you get a warning in node about a possible EventEmitter leak; I generally ignore this as I figured it was caused by the watch process. However, I'm seeing the same message here after I issue several SIGHUP's to the server. From the stack trace it looks like it's coming from this PR, as it starts from Repro: Maybe it's actually a bug in
|
@w33ble Fixed memory leak issues via |
jenkins, test it |
Passes 🎉 Re-running just in case jenkins, test it |
LGTM! |
A fix for #4407. Users can reload configuration through the following command even if
--no-watch
is turned on.The
even-better
package is a fork ofgood
that supports reloading configuration.