-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Refactor logger initialization #4065
Conversation
In the supervisor process, Fluentd initializes the logger twice, at `Supervisor::configure()` and `Supervisor.load_config()`. `Supervisor.load_config()` is called in ServerEngine's reloading function, but Fluentd doesn't use the function even when `SIGHUP` or `SIGUSR2`. So I can't see the reason for initializing the logger in the callback. In addition, I removed some needless parameters that were passed to ServerEngine. This also fixes a problem that `ignore_same_log_interval` is not passed to the `Supervisor.load_config()` and that option is not reflected to the logger of the supervisor process. Signed-off-by: Daijiro Fukuda <[email protected]>
39c6698
to
afee4a4
Compare
I rebased this to apply #4064. Please tell me if we need to investigate more about ServerEngine's reloading function. |
I am concerned that the https://github.com/fluent/fluentd/actions/runs/4320183945/jobs/7540167787
|
It's a known unstable test. |
Thanks, I have created the issue: |
You mean |
Sorry, I can't remember the code around it soon. |
No. Originally, fluentd/lib/fluent/supervisor.rb Lines 870 to 896 in e58fd66
So
|
The reason why I fixed the codes about fluentd/lib/fluent/supervisor.rb Line 887 in e58fd66
Since this PR removes the initialization process of the logger from fluentd/lib/fluent/supervisor.rb Lines 820 to 826 in e58fd66
Note: The following logic applies the fluentd/lib/fluent/supervisor.rb Lines 699 to 705 in e58fd66
|
Thus, I thought I didn't change the specification of |
Sure! Me too, sorry for the lack of explanation. |
About ServerEngine logic
I'll check the Windows just to be sure. |
On Windows, Fluentd overwrites fluentd/lib/fluent/supervisor.rb Lines 195 to 211 in 248160f
|
On Ubuntu focal, I have confirmed that sending On Windows, I have confirmed that using |
I'm checking the history... |
It seems that After #2716, there seems to be no longer any need to initialize the logger in |
I tried Fluentd v1.8.1, which does not include #2716, and I confirmed that sending From the above, I conclude as follows.
|
I have checked this. About
|
I have organized all the information. |
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.
Thanks for your detailed explanation! I've understood the issue.
It looks good to me.
I've added a nitpick comment in lines.
Signed-off-by: Daijiro Fukuda <[email protected]>
It is hard to understand what is this method and how it works. Signed-off-by: Daijiro Fukuda <[email protected]>
# For ServerEngine's `reload_config`. | ||
# This is called only at the initilization of the supervisor process, | ||
# since Fluentd overwrites all related SIGNAL(HUP,USR1,USR2) and have own | ||
# reloading feature. | ||
def self.load_config(path, params = {}) |
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.
Perhaps we should rename or move this method.
It is hard to understand what this method is.
I will do it in another PR.
Thanks! |
Thanks for your review! |
Which issue(s) this PR fixes:
I found this problem during fixing:
This fix should be done before fixing this issue.
What this PR does / why we need it:
In the supervisor process, Fluentd initializes the logger twice, at
Supervisor::configure()
andSupervisor.load_config()
.Supervisor.load_config()
is called in ServerEngine's reloading function, but Fluentd doesn't use the function even whenSIGHUP
orSIGUSR2
.So I can't see the reason for initializing the logger in that callback.
This also fixes a problem that
ignore_same_log_interval
is not passed to theSupervisor.load_config()
and that option is not reflected to the logger of the supervisor process.Docs Changes:
Not needed.
Release Note:
ignore_same_log_interval
option is not reflected in the supervisor process.suppress_repeated_stacktrace
from SystemConfig is not reflected in the worker processes.We should consider the release note with