fluent / fluent-package-builder

td-agent (Fluentd) Building and Packaging System
Apache License 2.0
21 stars 23 forks source link

linux: guard launching duplicated fluentd instance with same configuration #617

Closed kenhys closed 1 week ago

kenhys commented 4 months ago

linux: guard duplicated instance (not adding a new option)

Closes: #611

Before:

We can launch Fluentd by /usr/sbin/fluentd even though fluentd service is running.

Launching multiple Fluentd with the same config may cause inconsistency of the buffers or the pos files.

After:

We can't launch Fluentd by /usr/sbin/fluentd with the default config path if fluentd service is running. If one of the following options is specified, we can execute fluentd as before.

$ sudo /usr/sbin/fluentd 
Error: Can't start duplicate Fluentd instance with the default config.
To start Fluentd, please do one of the following:
(Caution: Please be careful not to start multiple instances with the same config.)
- Stop the Fluentd service 'fluentd'.
- Specify the config path explicitly by '-c' ('--config').
kenhys commented 4 months ago

NOTE: /opt/fluent/bin/fluentd is auto-generated file, so it should be patched.

kenhys commented 4 months ago

Observed service restarting in short times. Need to investigating further more.

kenhys commented 4 months ago

Update comment in this PR.

kenhys commented 4 months ago

Unexpectedly, download-artifact fails.

actions/download-artifact@master
Downloading single artifact
Preparing to download the following artifacts:
- packages-rockylinux-8 (ID: 1274111102, Size: 108455247)
Redirecting to blob download url: https://productionresultssa8.blob.core.windows.net/actions-results/b9412b87-4106-46a2-8fb0-86c757be7f85/workflow-job-run-ff7a8386-1a15-5f2b-97b2-c907b43b2f17/artifacts/6d0d09c616a6cee6f67320471aa47616aa04bd135f06b78e56dad6b651114b8f.zip
Starting download of artifact to: /home/runner/work/fluent-package-builder/fluent-package-builder
(node:1729) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Error: Unable to download artifact(s): Unable to download and extract artifact: Artifact download failed after 5 retries.
kenhys commented 4 months ago

It seems that there is no need to stick to download-artifact@master, created PR to use stable download-artifact@v4. https://github.com/fluent/fluent-package-builder/pull/624

kenhys commented 4 months ago

NOTE: download warning itself is not related to whether using download-artifact@master.

[bug] Node incompatibility: [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues https://github.com/actions/download-artifact/issues/283

kenhys commented 4 months ago

got it, it may be missing runtime package dependency.

kenhys commented 4 months ago

checking with timeout.

kenhys commented 4 months ago

As v5.0.3 is not released yet, test case in fresh install v5, lts should be skipped.

kenhys commented 4 months ago

With debug commit, it has passed on bookworm

https://github.com/fluent/fluent-package-builder/actions/runs/8077515347/job/22068761536?pr=617

image

On Rocky

https://github.com/fluent/fluent-package-builder/actions/runs/8077515348/job/22068663355

image

kenhys commented 4 months ago

It should pass CI. waiting results.

kenhys commented 4 months ago

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 something wrong with ffi gem dependency.

It should be fixed in another PR.

kenhys commented 4 months ago

https://github.com/fluent/fluent-package-builder/actions/runs/8077907378/job/22069129797?pr=617 something wrong with ffi gem dependency.

It may be not accurate.

https://github.com/fluent/fluent-package-builder/actions/runs/8076317129/job/22064585573 The version of ffi related gems are same as before.

kenhys commented 4 months ago

Failing on windows, but not related with this PR.

It is a bit strange, but it is not reproducible now...

kenhys commented 4 months ago

All checks has passed now!

kenhys commented 4 months ago

Now considering appropriate solution to make it simple.

A) guard /usr/sbin/fluentd and /opt/fluent/bin/fluentd

B) guard only /usr/sbin/fluentd

kenhys commented 1 week ago

waiting CI to pass...