Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upProperly handle concurrent access to qubes.xml #1729
Comments
marmarek
added
C: core
P: major
task
labels
Feb 9, 2016
marmarek
assigned
woju
Feb 9, 2016
marmarek
added this to the Release 4.0 milestone
Feb 9, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Feb 9, 2016
Member
As a stopgap I'll add detection of such situation and raise an exception. So at least it will be obvious what happened...
|
As a stopgap I'll add detection of such situation and raise an exception. So at least it will be obvious what happened... |
added a commit
to marmarek/old-qubes-core-admin
that referenced
this issue
Feb 10, 2016
added a commit
to woju/qubes-core-admin
that referenced
this issue
Feb 29, 2016
added a commit
to woju/qubes-core-admin
that referenced
this issue
Mar 3, 2016
added a commit
to woju/qubes-core-admin
that referenced
this issue
Mar 3, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
woju
Oct 26, 2016
Member
I'm working on such a schema: .__init__() will have additional argument lock, which when set to True will lock the file (with LOCK_EX) until .save() is executed. If loaded with lock=False, there will be .reload(), which again will have lock argument.
Attempt to .save() without locking first will be as in present situation, best-effort: will either succeed or fail when someone would have overwritten qubes.xml. Alternatively we can try to discourage developers from doing that by unconditionally failing, but it's probably bad idea, since the events would already be fired, so for existing code it would actually be worse than what is now.
There would be no equivalent for .lock_db_for_reading().
|
I'm working on such a schema: Attempt to There would be no equivalent for |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
marmarek
Oct 26, 2016
Member
I think this is very good compromise between usability and complexity.
|
I think this is very good compromise between usability and complexity. |
added a commit
to woju/qubes-core-admin
that referenced
this issue
Oct 27, 2016
added a commit
to woju/qubes-core-admin
that referenced
this issue
Oct 27, 2016
added a commit
to woju/qubes-core-admin
that referenced
this issue
Oct 28, 2016
added a commit
to woju/qubes-core-admin
that referenced
this issue
Oct 28, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
woju
Nov 24, 2016
Member
.reload() proved to be tricky. One can always instantiate new app object, if requred. So closing.
|
|
marmarek commentedFeb 9, 2016
When two tools concurrently modify
qubes.xml, one will "rollback" changes made by the other. Generally because each tool first loadqubes.xml, do it's work, then (optionally) rewrite the whole file with new state. In core2 we have two locking methods -lock_db_for_readingandlock_db_for_writing- if one want to modifyqubes.xml, he/she needs to take write (exclusive) lock.Not sure how it should be done here. Maybe somehow similar (but using
__init__()orload()parameter)?