Skip to content

fix(mqtt-out): keep Stop responsive when a publish blocks#17

Merged
ashaffah merged 1 commit into
mainfrom
fix/mqtt-out-publish-block
Jun 29, 2026
Merged

fix(mqtt-out): keep Stop responsive when a publish blocks#17
ashaffah merged 1 commit into
mainfrom
fix/mqtt-out-publish-block

Conversation

@ashaffah

Copy link
Copy Markdown
Owner

When the broker is unreachable the shared client's request queue fills and publish().await blocks, so the node never returned to its select to see the shutdown signal — it was aborted before releasing the shared connection, leaking the driver task (errors kept coming after Stop).

Race the publish against the shutdown signal so Stop interrupts a blocked publish, lets the node release the connection, and the driver is aborted. Verified: Stop returns in ~0.5s and mqtt errors cease (previously kept erroring after Stop).

When the broker is unreachable the shared client's request queue fills
and `publish().await` blocks, so the node never returned to its select to
see the shutdown signal — it was aborted before releasing the shared
connection, leaking the driver task (errors kept coming after Stop).

Race the publish against the shutdown signal so Stop interrupts a blocked
publish, lets the node release the connection, and the driver is aborted.
Verified: Stop returns in ~0.5s and mqtt errors cease (previously kept
erroring after Stop).
@ashaffah ashaffah merged commit d015813 into main Jun 29, 2026
1 check passed
@ashaffah ashaffah deleted the fix/mqtt-out-publish-block branch July 1, 2026 02:00
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