Skip to content
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

Updates can deadlock if state is being closed concurrently #100

Open
adamgundry opened this issue Aug 24, 2018 · 0 comments
Open

Updates can deadlock if state is being closed concurrently #100

adamgundry opened this issue Aug 24, 2018 · 0 comments

Comments

@adamgundry
Copy link
Contributor

It isn't terribly well specified what is supposed to happen if closeAcidState is called concurrently with an update transaction. The typical outcomes are that the update will either succeed or throw an error "Access failure: Core closed." While it would be nicer if this was a custom exception type rather than ErrorCall, this is fine.

However, sometimes a deadlock can result, with "FileLog has been closed" printed on the console (from the acid-state background writer thread, I think) and the update never returning. This seems wrong to me: I think the update should either succeed or throw an exception.

This isn't a big problem in typical server applications, because usually closeAcidState will be called right before program shutdown. But it might be a problem if an application wanted to close the state and keep working. Moreover, it makes it a pain to test for other race conditions involving closeAcidState and related operations.

I've put together a program demonstrating this.

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

No branches or pull requests

1 participant