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

command: fix NoMethodError of --daemon under Windows #4716

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

Watson1978
Copy link
Contributor

@Watson1978 Watson1978 commented Nov 26, 2024

Which issue(s) this PR fixes:
Fixes #4354

What this PR does / why we need it:
To daemonize the process, the following code will be invoked on Windows:

ServerEngine::Daemon.run_server(server_module, worker_module) { Fluent::Supervisor.serverengine_config(params) }

$log variable does not exist because it has not executed Superviser#setup_global_logger method until here.
It will perform a new startup process and prepare a logger in

ServerEngine::Daemon.run_server(server_module, worker_module) { Fluent::Supervisor.serverengine_config(params) }

This patch will only avoid the error since a logger is not required this process.

Docs Changes:
Not needed.

Release Note:
The same as the title.

@Watson1978 Watson1978 force-pushed the windows/daemon branch 2 times, most recently from 42435bf to ace524e Compare November 26, 2024 06:15
@Watson1978 Watson1978 changed the title daemon: setup global logger on Windows supervisor: avoid method calling on nil with --daemon flag under Windows Nov 26, 2024
@Watson1978 Watson1978 marked this pull request as ready for review November 26, 2024 06:32
@Watson1978 Watson1978 requested a review from daipom November 26, 2024 06:32
@daipom daipom added this to the v1.18.0 milestone Nov 26, 2024
@daipom
Copy link
Contributor

daipom commented Nov 26, 2024

Thanks!

Note:

Copy link
Contributor

@daipom daipom left a comment

Choose a reason for hiding this comment

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

LGTM.

@daipom daipom added the backport to LTS We will backport this fix to the LTS branch label Nov 26, 2024
@daipom daipom changed the title supervisor: avoid method calling on nil with --daemon flag under Windows supervisor: fix NoMethodError of --daemon under Windows Nov 26, 2024
@daipom daipom changed the title supervisor: fix NoMethodError of --daemon under Windows command: fix NoMethodError of --daemon under Windows Nov 26, 2024
@daipom daipom merged commit 713b738 into fluent:master Nov 26, 2024
13 of 16 checks passed
@Watson1978 Watson1978 deleted the windows/daemon branch November 27, 2024 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport to LTS We will backport this fix to the LTS branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows: cannot launch Fluentd with --daemon
2 participants