I noticed two issues while looking at (guix nar): 1. The proper store-lock-handling protocol isn't used in FINALIZE-STORE-FILE. Lock acquisition needs to check for a deletion token, retrying if it exists, and lock release needs to delete the lock file and write the deletion token. 2. WITH-TEMPORARY-STORE-FILE opens a new daemon connection every time it retries with a new filename, and only closes any of them after the body has completed. So if we retry 20 times, we get 20 concurrent daemon connections. This also prevents the call to LOOP from being a tail call. The attached patches resolve these issues. There are of course going to be more places we need to (properly) acquire and release store locks as guile-daemon code gets merged, but for now this should work as a bandaid fix. - reepca