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 race condition in standard renderer. #742

Conversation

collinvandyck
Copy link

@collinvandyck collinvandyck commented May 20, 2023

Issue: #741

When stopping the program, it would occasionally hang. Looking at the stacktrace, it is because the listen goroutine is trying to flush(), which needs the mutex, but because stop() also held the mutex, it would deadlock.

To address this we make lock aquisition a little more granular and break out the line clearing into a separate method which grabs and then releases the mutex.

When stopping the program, it would occasionally hang. Looking
at the stacktrace, it is because the listen goroutine is
trying to flush, which needs the mutext, but because stop()
also held the mutex, it would deadlock.
@collinvandyck collinvandyck force-pushed the collin/fix-mutex-lock-issue branch from 69a15fc to 54b888b Compare May 20, 2023 17:56
@muesli
Copy link
Contributor

muesli commented Jun 2, 2023

I think we might just want to move closing the channel above the final flush and clear line. Preparing a PR to test.

@collinvandyck
Copy link
Author

collinvandyck commented Jun 2, 2023

Ah I like your PR much better. thanks for taking a look!

@collinvandyck
Copy link
Author

Fixed in #757

@collinvandyck collinvandyck deleted the collin/fix-mutex-lock-issue branch June 5, 2023 12:56
# 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