Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix a deadlock in the consumer mock #451

Merged
merged 1 commit into from
Apr 28, 2024

Conversation

moonpolysoft
Copy link
Contributor

Found a deadlock in the MockAutoPartitionConsumer. The Close() function does all of its work from within a sync.Once. However, the AsyncClose() function utilizes the same sync.Once to do its work. Close() calls AsyncClose() from within the once invocation and results in a deadlock as the mutex is being held by the outer Close().

This change inlines the operations AsyncClose() would've performed into the main body of Close(), removing the possibility for deadlock.

@frairon
Copy link
Contributor

frairon commented Apr 28, 2024

Good catch, thanks a lot @moonpolysoft !

@frairon frairon merged commit d8004e7 into lovoo:master Apr 28, 2024
4 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants