Skip to content

Reset event-bus pusher on failed fire_event send (#69914) - #69937

Open
twangboy wants to merge 2 commits into
saltstack:3006.xfrom
twangboy:fix/69914/3006.x
Open

Reset event-bus pusher on failed fire_event send (#69914)#69937
twangboy wants to merge 2 commits into
saltstack:3006.xfrom
twangboy:fix/69914/3006.x

Conversation

@twangboy

@twangboy twangboy commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

SaltEvent.fire_event() re-raised send failures without resetting self.pusher/self.cpush, so once an MWorker's IPC pusher stream broke (e.g. a stale epoll fd after EventPublisher restarts), every subsequent job return on that worker hit the same exception forever, silently dropping the return before it reached the job cache and burning memory/CPU on repeated thread+IOLoop churn. Close the pusher on failure, mirroring the existing reconnect pattern on the subscribe side, so the next fire_event() call reconnects instead.

What issues does this PR fix or reference?

Fixes #69914

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

SaltEvent.fire_event() re-raised send failures without resetting
self.pusher/self.cpush, so once an MWorker's IPC pusher stream broke
(e.g. a stale epoll fd after EventPublisher restarts), every
subsequent job return on that worker hit the same exception forever,
silently dropping the return before it reached the job cache and
burning memory/CPU on repeated thread+IOLoop churn. Close the pusher
on failure, mirroring the existing reconnect pattern on the subscribe
side, so the next fire_event() call reconnects instead.
@twangboy
twangboy requested a review from a team as a code owner August 3, 2026 22:32
@twangboy twangboy added the test:full Run the full test suite label Aug 3, 2026
@twangboy twangboy self-assigned this Aug 3, 2026
@twangboy twangboy added this to the Sulphur v3006.28 milestone Aug 3, 2026

@dwoz dwoz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this one deserves at least one functional or integration test.

dwoz requested a functional/integration test on PR saltstack#69937 since the
existing unit test only exercised a mocked pusher. Add a test that
spins up a real EventPublisher and a real SaltEvent pusher, fakes a
send() failure at the IPCMessageClient boundary to reproduce the
reported FileNotFoundError deterministically, and asserts the pusher
is dropped and a subsequent fire_event() reconnects and actually
delivers the event to a live listener.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Memory leak in salt-master 3006.27

2 participants