You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 thanErrorCall
, 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 involvingcloseAcidState
and related operations.I've put together a program demonstrating this.
The text was updated successfully, but these errors were encountered: