Skip to content

feat(inputs.bklite_script): support configurable timeout capped at interval-1s - #4

Merged
ZhongmingFan merged 1 commit into
bklitefrom
cursor/bklite-script-timeout-984f
Sep 30, 2026
Merged

ZhongmingFan merged 1 commit into
bklitefrom
cursor/bklite-script-timeout-984f

Conversation

@ZhongmingFan

Copy link
Copy Markdown

Summary

inputs.bklite_script now accepts an optional timeout (config.Duration) on [[inputs.bklite_script]].

Effective timeout is min(configured timeout, interval − 1s). Unset or 0 keeps the previous default (interval − 1s), so existing configs are unchanged. Interval ≤ 1s is still guarded by derivedTimeout (return interval as-is).

When a configured value exceeds the cap, it is clamped and a warning is logged once at Init (interval is already required and known there). On timeout the child is still killed and bklite_script health metrics still record exit_code = 124.

Checklist

  • No AI generated code was used in this PR

Related issues

No linked GitHub issue.

Verify

go build ./plugins/inputs/bklite_script/...
go vet ./plugins/inputs/bklite_script
go test ./plugins/inputs/bklite_script/ -count=1

Note: the fork workflow pr-target-branch.yml fails because it requires PRs onto master. This PR is intentionally based on bklite.

Open in Web Open in Cursor 

…terval-1s

Accept timeout on [[inputs.bklite_script]]. Effective timeout is
min(configured, interval-1s); unset or 0 keeps interval-1s. Clamp
warnings are logged once at Init.
@ZhongmingFan
ZhongmingFan marked this pull request as ready for review September 30, 2026 01:34
@ZhongmingFan
ZhongmingFan merged commit 87f27bb into bklite Sep 30, 2026
2 of 3 checks passed
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.

1 participant