Skip to content

fix: replace assert with early return in out_event when _io_error is set - #4852

Closed
ssam18 wants to merge 1 commit into
zeromq:masterfrom
ssam18:fix/out-event-io-error-assert
Closed

fix: replace assert with early return in out_event when _io_error is set#4852
ssam18 wants to merge 1 commit into
zeromq:masterfrom
ssam18:fix/out-event-io-error-assert

Conversation

@ssam18

@ssam18 ssam18 commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

When the I/O thread collects both POLLIN and POLLOUT from the same epoll_wait batch, processing the POLLIN can set _io_error via in_event_internal(), and the already-queued POLLOUT still gets dispatched to out_event() — hitting the assert and crashing. Replacing the assert with an early return handles this gracefully, consistent with the same guard already present in restart_output(). Fixes #4841.

@bluca

bluca commented Jul 2, 2026

Copy link
Copy Markdown
Member

If an assert is hit it means there is a programming error somewhere else that results in an invalid/undefined state. Just removing the assert and ignoring the error is wrong and leaves the underlying problem lurking about.

@bluca bluca closed this Jul 2, 2026
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.

Race condition: assertion failure in stream_engine_base.cpp: out_event() when _io_error is set

2 participants