Skip to content

Conversation

@streamnativebot
Copy link
Contributor

@streamnativebot streamnativebot commented Sep 10, 2025

No description provided.

The async producer was not honoring the context passed to SendAsync,
which violated Go's context conventions. When the Pulsar broker connection
was lost, the producer would continue attempting to send messages indefinitely.

Changes:
- Check context cancellation in the event loop before processing send requests
- Check context before processing internalSend
- Use the original request context when writing data instead of creating new one
- Add context checking in clearPendingSendRequests

This ensures that when a context is canceled (due to timeout or manual cancellation),
the send operation will fail immediately with ErrContextExpired instead of blocking
indefinitely.

Fixes: streamnative/eng-support-tickets#3170
@BewareMyPower
Copy link
Contributor

Close AI PR

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.

2 participants