You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
<system> umask / --umask` is not applied to worker-created files under a foreground supervisor #5435
Both --umask and <system> umask set the process umask, but the effect on worker-created files (e.g. file buffer chunks) depends on the run mode:
--no-supervisor (standalone): applied — Fluentd calls File.umask directly in the worker.
Supervised + --daemon (daemonize, e.g. fluent-package): applied — ServerEngine sets the umask before spawning workers, so workers inherit it.
Supervised without --daemon (foreground): not applied — ServerEngine's non-daemonize path doesn't call File.umask, and Fluentd doesn't pass worker_chumask, so workers keep the inherited (shell) umask.
Verified on all three modes: a file buffer chunk created with umask 0077 is 0600 under --no-supervisor and --daemon, but stays 0644 when running fluentd -c fluent.conf in the foreground.
This is existing behavior, not a regression from #5390. Opening this to decide whether to close the gap (e.g. by passing worker_chumask to ServerEngine so foreground workers honor the umask too) or to document it as a known limitation of the run mode.
Describe the solution you'd like
Make --umask / <system> umask also apply to worker-created files under a foreground supervisor (e.g. by passing worker_chumask to ServerEngine so workers set their umask explicitly rather than relying on inheritance)
Describe alternatives you've considered
If the current behavior is intentional, document the per-mode applicability instead, so foreground-supervisor users don't expect it to affect buffer file permissions.
I can apply the umask explicitly in the worker startup path so it's set unconditionally, the same way the --no-supervisor branch already does it, instead of depending on ServerEngine's daemonize-only File.umask call.
I'll dig into the worker bootstrap code to confirm the right place to put this and check whether it needs any ServerEngine-side change or can be done entirely on the fluentd side.
Planning to add a test similar to #5390, but asserting the 0600/0644 behavior specifically for the foreground-supervised mode.
Activity
mbmtbtbc commentedon Jul 15, 2026
Hey, I'd like to work on this.
I can apply the umask explicitly in the worker startup path so it's set unconditionally, the same way the
--no-supervisorbranch already does it, instead of depending on ServerEngine's daemonize-onlyFile.umaskcall.I'll dig into the worker bootstrap code to confirm the right place to put this and check whether it needs any ServerEngine-side change or can be done entirely on the fluentd side.
Planning to add a test similar to #5390, but asserting the 0600/0644 behavior specifically for the foreground-supervised mode.
Please let me know if the approach is correct.