-
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
Set system config variables explicitly #2674
Set system config variables explicitly #2674
Conversation
Signed-off-by: Yuta Iwama <[email protected]>
Signed-off-by: Yuta Iwama <[email protected]>
Signed-off-by: Yuta Iwama <[email protected]>
Signed-off-by: Yuta Iwama <[email protected]>
Use @system_config via access the ivar not to expose ivar to supervisor Signed-off-by: Yuta Iwama <[email protected]>
Signed-off-by: Yuta Iwama <[email protected]>
Signed-off-by: Yuta Iwama <[email protected]>
Signed-off-by: Yuta Iwama <[email protected]>
Signed-off-by: Yuta Iwama <[email protected]>
supervise is used in lib/command/fluentd.rb Signed-off-by: Yuta Iwama <[email protected]>
…deprecated Signed-off-by: Yuta Iwama <[email protected]>
Signed-off-by: Yuta Iwama <[email protected]>
Signed-off-by: Yuta Iwama <[email protected]>
Signed-off-by: Yuta Iwama <[email protected]>
de4e220
to
75a37eb
Compare
test/plugin/test_in_monitor_agent.rb
Outdated
s = Fluent::Supervisor.new(opts.merge(config_path: filepath)) | ||
s.configure | ||
ensure | ||
FileUtils.rm_r(CONFIG_DIR) rescue StandardError |
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.
what does 'rescue StandardError' mean?
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.
In order to resue Errno::ENOENT
which happens when directory doesn't exist.
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.
Your code means rescue returns StandardError
, not catch StandardError
.
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.
oh… I misunderstood something………… 29fd4d7
end | ||
|
||
def change_privilege | ||
ServerEngine::Privilege.change(@chuser, @chgroup) | ||
end | ||
|
||
def init_engine(supervisor: false) | ||
def init_engine | ||
Fluent::Engine.init(@system_config) |
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.
init_engine
is now only one line. Can we replace init_engine
with Fluent::Engine.init
?
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.
I left it a method because others such as Supervisor#change_privilege, Supervisor#run_configure, Supervisor#run_engine are the same situation.
Do you think it's better to change these methods at this time? (I don't have a strong opinion about it. so if you have any opinion, I follow yours)
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.
I see. So it should be in other patch for refactor methods.
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.
i'll do it 👍
Signed-off-by: Yuta Iwama <[email protected]>
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.
Please merge after test passed.
Which issue(s) this PR fixes:
Ref #2624
What this PR does / why we need it:
Use
@system_config
explicitly so that supervisor doesn't need to expose all context to system_config. the current implementation is hard to understand since there are too many states.Docs Changes:
no need
Release Note:
no need