Skip to content

Commit

Permalink
Adding locks for cache directories in case multiple processes are try…
Browse files Browse the repository at this point in the history
…ing to create an environment at the same time

Change-Id: Ib71f328f345569868602de32945f56d6f65096fd
  • Loading branch information
rmittal87 committed Sep 6, 2023
1 parent bbac096 commit a6fbe46
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions libmamba/src/api/install.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,16 @@ namespace mamba
);
}

MTransaction trans(pool, solver, package_caches);
std::vector<LockFile> locks;

for (auto& c : ctx.pkgs_dirs)
{
locks.push_back(LockFile(c));
}

if (ctx.output_params.json)
MTransaction trans(pool, solver, package_caches);

if (ctx.output_params.json)
{
trans.log_json();
}
Expand Down Expand Up @@ -655,8 +662,15 @@ namespace mamba
// Note that the Transaction will gather the Solvables,
// so they must have been ready in the pool before this line
auto transaction = create_transaction(pool, pkg_caches, others);

if (ctx.output_params.json)

std::vector<LockFile> lock_pkgs;

for (auto& c : ctx.pkgs_dirs)
{
lock_pkgs.push_back(LockFile(c));
}

if (ctx.output_params.json)
{
transaction.log_json();
}
Expand Down

0 comments on commit a6fbe46

Please sign in to comment.