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
bug: tcp/udp inputs accept max_open_files and ignore it silently #1075
Network inputs tcp and udp accept max_open_files during validation even though the setting only makes sense for file-based inputs. The field is silently ignored instead of being rejected as irrelevant.
Reproduction
This config validates successfully even though tcp has no open-file limit:
max_open_files is currently accepted for tcp/udp and ignored at runtime; the fix should be a config-validation guard in logfwd-config that restricts it to file inputs.
Recommendation
Reject max_open_files whenever input_type != file (at least tcp/udp; ideally also generator/otlp/arrow_ipc for consistency with #1072), while keeping the existing max_open_files >= 1 check for file.
Key files
crates/logfwd-config/src/lib.rs:233-245 — InputConfig defines max_open_files: Option(usize) with docstring “Applies only to file inputs.”
crates/logfwd-config/src/lib.rs:594-674 — Config::validate() input validation; currently only rejects max_open_files == 0 (:668-673), regardless of input type.
crates/logfwd/src/pipeline.rs:1269-1362 — build_input_state(...); max_open_files is consumed only in InputType::File (:1282-1287), not in udp/tcp branches (:1331-1361).
crates/logfwd-io/src/tcp_input.rs:79-81 — TcpInput::new(name, addr) signature has no open-file parameter.
crates/logfwd-io/src/udp_input.rs:34-35 — UdpInput::new(name, addr) signature has no open-file parameter.
crates/logfwd-io/src/tail.rs:132-160,963-964 — TailConfig.max_open_files and LRU eviction usage (file-only behavior).
Findings
The config layer exposes max_open_files on all input objects because InputConfig is shared across input types (crates/logfwd-config/src/lib.rs:233-245).
Validation currently enforces only lower-bound (!= 0) and does not enforce applicability by input type (crates/logfwd-config/src/lib.rs:668-673).
Runtime behavior confirms silent ignore for network inputs: pipeline wiring only passes max_open_files into TailConfig in the file branch (crates/logfwd/src/pipeline.rs:1282-1287).
Existing validation pattern for “field only valid for specific type” already exists (request_mode is only supported for elasticsearch outputs, crates/logfwd-config/src/lib.rs:734-737), which is a good template for this fix.
Docs currently list only path under file input fields and do not mention max_open_files (book/src/config/reference.md:83-90), so docs should be updated to avoid ambiguity.
Verification
I ran targeted CLI/config checks locally:
$ cargo run -q -p logfwd -- --config (tcp-with-max_open_files).yaml --validate
TCP_VALIDATE_EXIT=0
ready: default
config ok: 1 pipeline(s)
$ cargo run -q -p logfwd -- --config (udp-with-max_open_files).yaml --validate
UDP_VALIDATE_EXIT=0
ready: default
config ok: 1 pipeline(s)
$ cargo run -q -p logfwd -- --validate --config (file-max_open_files-0).yaml
FILE_ZERO_EXIT=1
error: config validation error: pipeline 'default' input '#0': max_open_files must be at least 1
$ RUSTC_WRAPPER= cargo test -q -p logfwd-config max_open_files -- --nocapture
running 3 tests
...
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 54 filtered out
Detailed Action Plan
In crates/logfwd-config/src/lib.rs inside Config::validate() input loop (~638+), split max_open_files validation by input.input_type:
file: keep current == 0 rejection.
non-file: if max_open_files.is_some(), return validation error like:
pipeline '{name}' input '{label}': max_open_files is only supported for file inputs.
Add config tests in crates/logfwd-config/src/lib.rs near existing max_open_files_* tests (:1695+):
Add/adjust one integration-level validation case in crates/logfwd/tests/it/integration.rs near test_config_validation_errors (:382+) if maintainers want CLI-surface coverage beyond unit tests.
Update book/src/config/reference.md under file input fields (:83-90) to explicitly document max_open_files as file-only with default 1024.
Open PRs in this area
Using local branch diff against fetched open PR heads:
Integrity filtering activated and filtered the following items during workflow execution.
This happens when a tool call accesses a resource that does not meet the required integrity or secrecy level of the workflow.
resource:search_pull_requests (search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)
Validation: CONFIRMED — shared root cause with all silent-ignore config issues
Both InputConfig and OutputConfig are single flat structs (#[serde(deny_unknown_fields)]) with fields shared across all input/output types. Config::validate() checks that required fields are present for each type but does not reject extraneous optional fields that have no meaning for the selected type.
crates/logfwd-output/src/lib.rs: runtime builders use match cfg.output_type and silently ignore fields not consumed by the selected arm.
crates/logfwd-config/src/lib.rsConfig::validate(): validates required fields per type but has no reject-if-present checks for inapplicable optional fields.
Unified fix — add per-type field rejection to Config::validate():
// Example for OutputConfig:match output.output_type{OutputType::Stdout | OutputType::Null => {if output.endpoint.is_some(){warn_or_err("endpoint not used by this output type");}if output.index.is_some(){warn_or_err("index not used by this output type");}if output.compression.is_some(){warn_or_err("compression not used by this output type");}if output.auth.is_some(){warn_or_err("auth not used by this output type");}// etc.}OutputType::Elasticsearch => {if output.protocol.is_some(){warn_or_err("protocol not used by elasticsearch");}// etc.}// ...}
A single pass over all output types covering all optional fields fixes all 12 related issues at once.
Fixed on master in PR #1123 (923a033bd8e855f4011f8ad9d5248b9e44a3546a).
I rechecked origin/master; these type-inappropriate config fields are now rejected during validation, so this issue/work-unit looks stale and safe to close.
Activity
github-actions commentedon Apr 5, 2026
max_open_filesis currently accepted fortcp/udpand ignored at runtime; the fix should be a config-validation guard inlogfwd-configthat restricts it tofileinputs.Recommendation
Reject
max_open_fileswheneverinput_type != file(at leasttcp/udp; ideally alsogenerator/otlp/arrow_ipcfor consistency with #1072), while keeping the existingmax_open_files >= 1check forfile.Key files
crates/logfwd-config/src/lib.rs:233-245—InputConfigdefinesmax_open_files: Option(usize)with docstring “Applies only tofileinputs.”crates/logfwd-config/src/lib.rs:594-674—Config::validate()input validation; currently only rejectsmax_open_files == 0(:668-673), regardless of input type.crates/logfwd/src/pipeline.rs:1269-1362—build_input_state(...);max_open_filesis consumed only inInputType::File(:1282-1287), not inudp/tcpbranches (:1331-1361).crates/logfwd-io/src/tcp_input.rs:79-81—TcpInput::new(name, addr)signature has no open-file parameter.crates/logfwd-io/src/udp_input.rs:34-35—UdpInput::new(name, addr)signature has no open-file parameter.crates/logfwd-io/src/tail.rs:132-160,963-964—TailConfig.max_open_filesand LRU eviction usage (file-only behavior).Findings
max_open_fileson all input objects becauseInputConfigis shared across input types (crates/logfwd-config/src/lib.rs:233-245).!= 0) and does not enforce applicability by input type (crates/logfwd-config/src/lib.rs:668-673).max_open_filesintoTailConfigin thefilebranch (crates/logfwd/src/pipeline.rs:1282-1287).request_mode is only supported for elasticsearch outputs,crates/logfwd-config/src/lib.rs:734-737), which is a good template for this fix.pathunderfileinput fields and do not mentionmax_open_files(book/src/config/reference.md:83-90), so docs should be updated to avoid ambiguity.Verification
I ran targeted CLI/config checks locally:
Detailed Action Plan
crates/logfwd-config/src/lib.rsinsideConfig::validate()input loop (~638+), splitmax_open_filesvalidation byinput.input_type:file: keep current== 0rejection.file: ifmax_open_files.is_some(), return validation error like:pipeline '{name}' input '{label}': max_open_files is only supported for file inputs.crates/logfwd-config/src/lib.rsnear existingmax_open_files_*tests (:1695+):tcp+max_open_files=> error.udp+max_open_files=> error.generatorandotlp+max_open_files=> error.max_open_files_one_accepted, absent accepted) unchanged.crates/logfwd/tests/it/integration.rsneartest_config_validation_errors(:382+) if maintainers want CLI-surface coverage beyond unit tests.book/src/config/reference.mdunderfileinput fields (:83-90) to explicitly documentmax_open_filesas file-only with default1024.Open PRs in this area
Using local branch diff against fetched open PR heads:
copilot/adopt-thiserror-2-0)crates/logfwd-config/src/lib.rsandcrates/logfwd/src/pipeline.rscopilot/convert-jsonlines-sink-to-reqwest)logfwd-config/input files abovecopilot/perf-find-throughput-ceiling)logfwd-config/input files aboveRelated Items
generator/otlp) acceptingmax_open_filesmax_open_files >= 1) for file inputsmax_open_filesbehaviorcrates/logfwd-config/src/lib.rscrates/logfwd/src/pipeline.rsmax_open_filesis file-branch-only at runtimebook/src/config/reference.mdmax_open_filesfile-only documentationNote
🔒 Integrity filtering filtered 6 items
Integrity filtering activated and filtered the following items during workflow execution.
This happens when a tool call accesses a resource that does not meet the required integrity or secrecy level of the workflow.
issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)search_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)pull_request_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)pull_request_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)pull_request_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".)What is this? | From workflow: Issue Triage
Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.
strawgate commentedon Apr 5, 2026
Validation: CONFIRMED — shared root cause with all silent-ignore config issues
Both
InputConfigandOutputConfigare single flat structs (#[serde(deny_unknown_fields)]) with fields shared across all input/output types.Config::validate()checks that required fields are present for each type but does not reject extraneous optional fields that have no meaning for the selected type.This bug is one of ~12 confirmed instances of the same pattern (see also #1057, #1058, #1060, #1064, #1065, #1066, #1070, #1071, #1072, #1073, #1075, #1077, #1078).
Root cause confirmed:
crates/logfwd-output/src/lib.rs: runtime builders usematch cfg.output_typeand silently ignore fields not consumed by the selected arm.crates/logfwd-config/src/lib.rsConfig::validate(): validates required fields per type but has no reject-if-present checks for inapplicable optional fields.Unified fix — add per-type field rejection to
Config::validate():A single pass over all output types covering all optional fields fixes all 12 related issues at once.
fix(config): reject type-inappropriate fields in input/output validation
fix(config): reject type-inappropriate fields in input/output validation
fix(config): reject type-inappropriate fields in input/output validation
strawgate commentedon Apr 5, 2026
Fixed on
masterin PR #1123 (923a033bd8e855f4011f8ad9d5248b9e44a3546a).I rechecked
origin/master; these type-inappropriate config fields are now rejected during validation, so this issue/work-unit looks stale and safe to close.