repo: Use per-transaction staging dir
Concurrent pulls break since we're sharing the staging directory for all transactions in the repo. This makes us use a per-transaction directory. However, in order for resumes to work we first look for existing staging directories and try to aquire an exclusive lock for them. If we can't find any staging directory or they are all already locked, then we create a new one. https://bugzilla.gnome.org/show_bug.cgi?id=757611
This commit is contained in:
1 parent
be19c88861
commit
f771461b4a
3 files changed
+23
-33
No files matched your search
@@ -514,6 +514,7 @@ ostree_repo_finalize (GObject *object)
|
||||
if (self->commit_stagedir_fd != -1)
|
||||
(void) close (self->commit_stagedir_fd);
|
||||
g_free (self->commit_stagedir_name);
|
||||
glnx_release_lock_file (&self->commit_stagedir_lock);
|
||||
g_clear_object (&self->tmp_dir);
|
||||
if (self->tmp_dir_fd)
|
||||
(void) close (self->tmp_dir_fd);
|
||||
@@ -674,6 +675,7 @@ static void
|
||||
ostree_repo_init (OstreeRepo *self)
|
||||
{
|
||||
static gsize gpgme_initialized;
|
||||
GLnxLockFile empty_lockfile = GLNX_LOCK_FILE_INIT;
|
||||
|
||||
if (g_once_init_enter (&gpgme_initialized))
|
||||
{
|
||||
@@ -694,6 +696,7 @@ ostree_repo_init (OstreeRepo *self)
|
||||
self->commit_stagedir_fd = -1;
|
||||
self->objects_dir_fd = -1;
|
||||
self->uncompressed_objects_dir_fd = -1;
|
||||
self->commit_stagedir_lock = empty_lockfile;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user