Skip to content

Conversation

@Watson1978
Copy link
Contributor

@Watson1978 Watson1978 commented Oct 3, 2025

Backport #921

We should exclude /tmp/fluentd-lock-* directory. If /tmp/fluentd-lock-* is cleaned up while Fluentd is running:

  • out_file can fail flushing.
  • out_secondary can fail flushing.
  • The supervisor process exit abnormally when Fluentd stops.

At least, RHEL 8 has the following default conf for tmpfiles.d:

/usr/lib/tmpfiles.d/tmp.conf

q /tmp 1777 root root 10d

This can delete directories under /tmp if they are not used for more than 10 days.

We don't need to protect the old lock files under
/tmp/fluentd-lock-*/, so use X instead of x.

In configs where lock files are not used, there is no problem even if this directory is deleted.
In configurations that do use lock files, it’s unlikely that this directory would not be updated for more than 10 days. Therefore, the cases where this actually becomes an issue should be quite limited. If only out_secondary_file uses lock files, this can become an issue.

We should exclude `/tmp/fluentd-lock-*` directory.
If `/tmp/fluentd-lock-*` is cleaned up while Fluentd is running:

* out_file can fail flushing.
* out_secondary can fail flushing.
* The supervisor process exit abnormally when Fluentd stops.

At least, RHEL 8 has the following default conf for tmpfiles.d:

/usr/lib/tmpfiles.d/tmp.conf

    q /tmp 1777 root root 10d

This can delete directories under `/tmp` if they are not used for more
than 10 days.

We don't need to protect the old lock files under
`/tmp/fluentd-lock-*/`, so use `X` instead of `x`.

In configs where lock files are not used, there is no problem even if
this directory is deleted.
In configurations that do use lock files, it’s unlikely that this
directory would not be updated for more than 10 days. Therefore, the
cases where this actually becomes an issue should be quite limited.
If only out_secondary_file uses lock files, this can become an issue.

Signed-off-by: Daijiro Fukuda <[email protected]>
Signed-off-by: Shizuo Fujita <[email protected]>
@Watson1978 Watson1978 added this to the v6.0.1 milestone Oct 3, 2025
@Watson1978 Watson1978 requested a review from daipom October 3, 2025 04:28
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.

Thanks!
The CI failures are not related to this PR.

@daipom daipom merged commit fd55300 into fluent-package-v6 Oct 3, 2025
265 of 290 checks passed
@daipom daipom deleted the backport-pr921-to-v6 branch October 3, 2025 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants