-
Notifications
You must be signed in to change notification settings - Fork 23
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
Guard launching duplicated fluentd instance with same configuration #617
base: master
Are you sure you want to change the base?
Conversation
NOTE: /opt/fluent/bin/fluentd is auto-generated file, so it should be patched. |
0dcba92
to
ab8f2bd
Compare
b1fc5b9
to
d341283
Compare
Observed service restarting in short times. |
f860f53
to
3e89a51
Compare
Update comment in this PR. |
3e89a51
to
2915677
Compare
Unexpectedly, download-artifact fails.
|
It seems that there is no need to stick to download-artifact@master, created PR to use stable download-artifact@v4. |
NOTE: [bug] Node incompatibility: [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues |
f0960bd
to
96c47f9
Compare
got it, it may be missing runtime package dependency. |
db39aca
to
528ba69
Compare
checking with timeout. |
27fd5fd
to
5320ed8
Compare
As v5.0.3 is not released yet, test case in fresh install v5, lts should be skipped. |
With debug commit, it has passed on bookworm https://github.com/fluent/fluent-package-builder/actions/runs/8077515347/job/22068761536?pr=617 On Rocky https://github.com/fluent/fluent-package-builder/actions/runs/8077515348/job/22068663355 |
5320ed8
to
3819a0e
Compare
It should pass CI. waiting results. |
CI has passed except windows. Failing on windows, but not related with this PR. https://github.com/fluent/fluent-package-builder/actions/runs/8077907378/job/22069129797?pr=617 It should be fixed in another PR. |
It may be not accurate. https://github.com/fluent/fluent-package-builder/actions/runs/8076317129/job/22064585573 |
It is a bit strange, but it is not reproducible now... |
All checks has passed now! |
3819a0e
to
5ba3ff4
Compare
Now considering appropriate solution to make it simple. A) guard /usr/sbin/fluentd and /opt/fluent/bin/fluentd
B) guard only /usr/sbin/fluentd
|
5ba3ff4
to
b3e30ac
Compare
Before: Even though fluentd service is running, you can execute duplicated Fluentd instance. It may cause inconsistency lost of buffer or pos file. After: Guard multiple Fluentd instance when fluentd service is running by default. Note that --force-running-multiple-instance option is specified, you can run additional Fluentd instance explicitly. (it is same as previous behavior) NOTE: This guard trick is effective when /usr/sbin/fluentd is executed via sudo. It doesn't work when /opt/fluent/bin/fluentd is executed directly. This is intentinal because usually /opt/fluent/bin/fluentd is not searched from PATH. Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
b3e30ac
to
9b9ec9e
Compare
Guard launching duplicated fluentd instance with same configuration
Concept;
Inject blocking code to /opt/fluent/bin/fluentd.
Before:
If you launch multiple Fluentd instance with same
configuration file, it causes a disaster with inconsistent
processed buffer or pos file.
After:
Detect fluentd service's main process and fetch FLUENT_CONF.
if configuration is same as spawned process, abort it.
It can block the following conditions are met:
fluentd is launched as a systemd service.
configuration file is specified via FLUENT_CONF in fluentd.service.
manually try to launch fluentd with same configuration file like this:
sudo /usr/sbin/fluentd -c /etc/fluent/fluentd.conf
sudo /usr/sbin/fluentd
sudo /opt/fluent/bin/fluentd -c /etc/fluent/fluentd.conf
Note that following case doen't resolved.
because default configuration path is /etc/fluent/fluent.conf.
This is because there is no appropriate privilege to retrieve
command line parameters.
NOTE: Windows is out of scope in this PR.