Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(agent): Restore setup order of stateful plugins to Init() then SetState() #16123

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Nov 1, 2024

Summary

PR #15170 changed the startup sequence of stateful plugins from Init -> SetState to SetState -> Init and in turn broke all stateful users (inputs.tail, inputs.docker_log, inputs.win_eventlog and processors.dedup) to make starlark state-persistence work.

As a code sequence of Init -> SetState is the expected behavior and what works for all previous users, this PR restores the old order and fixes common.starlark to also work with this sequencing. The PR furthermore adds unit-tests where possible to make sure the sequence works. Last but not least, the PR updates the spec and also defines the shutdown order to be Close/Stop -> GetState.

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #16037

@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Nov 1, 2024
@srebhan srebhan self-assigned this Nov 1, 2024
@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Nov 1, 2024

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Nov 11, 2024
@srebhan srebhan assigned DStrand1 and unassigned srebhan Nov 11, 2024
@srebhan srebhan changed the title fix: Restore setup order of stateful plugins to Init() then SetState() fix(agent): Restore setup order of stateful plugins to Init() then SetState() Nov 11, 2024
@DStrand1 DStrand1 merged commit 35fe105 into influxdata:master Nov 13, 2024
29 checks passed
@github-actions github-actions bot added this to the v1.32.3 milestone Nov 13, 2024
srebhan added a commit that referenced this pull request Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/agent fix pr to fix corresponding bug ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Telegraf is running SetState() before Init().
2 participants