Re: What ostree operations are safe to do concurrently

On Thu, 2015-12-03 at 10:06 -0500, Colin Walters wrote:
On Thu, Dec 3, 2015, at 09:50 AM, Alexander Larsson wrote:

But, what about write changes like a pull? Is this safe for
callers? If it is not, how should i protect things from problems.
Do i
need a repo-global lock, or can i somehow do partial locking?

I intended pull to be concurrent, but this bug breaks it right now:

I think if we fix that, that'd be pretty much all you need, right?

Well, that would fix the pull, but what about remove. I mean, we do
want to support uninstall apps, and we call ostree_repo_prune with
depth=0 on updates. This can break in-progress pulls at the very least.
I can also imagine it breaking if you do a prune and update a ref
halfway that things would break.

Maybe I can have some kind of reader-writer lock that we take (for
write) on uninstall to protect any ongoing pulls (they take a read
lock). We could also skip the prune if any other operation is ongoing,
as it will be run eventually anyway.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]