Skip to content

[2.x] Make consumer DisposeAsync execute in the backgroundTask (#309) #310

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

Merged
merged 3 commits into from
Apr 16, 2025

Conversation

RobertIndie
Copy link
Contributor

Cherry-pick: #309

Motivation

The producer.DisposeAsync runs in the background, while the consumer does not. This can cause inconsistent behavior between closing the producer and the consumer. For example, if a user wants to wait for the result of consumer.DisposeAsync using GetAwaiter, it may lead to a deadlock if ConfigureAwait(false) is not set. It is better to run this dispose in the background to avoid deadlock issues and to ensure consistent behavior with the producer.


Co-authored-by: Vladimir Shchur [email protected]
(cherry picked from commit 096bc23)

)

* Make consumer DisposeAsync execute in the backgroundTask

* Update pulsar test image

---------

Co-authored-by: Vladimir Shchur <[email protected]>
(cherry picked from commit 096bc23)
@RobertIndie RobertIndie marked this pull request as ready for review April 15, 2025 10:57
@RobertIndie
Copy link
Contributor Author

Could you help take a look at the CI error? Seems not related to this PR.

@Lanayx
Copy link
Member

Lanayx commented Apr 15, 2025

@RobertIndie Ubuntu image needs to be updated

@RobertIndie
Copy link
Contributor Author

@RobertIndie Ubuntu image needs to be updated

Thanks. The CI has passed

@Lanayx Lanayx merged commit 0be2f65 into fsprojects:2.x Apr 16, 2025
2 checks passed
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