Add a grace period to obtain the lock to avoid "Error: lock /data/ipfs/repo.lock: someone else has the lock" #10482
Labels
kind/enhancement
A net-new feature or improvement to an existing feature
Checklist
Description
I want to use IPFS to distribute an OS update image to 100s of hosts in my compute estate, but I've been seeing a lot of the following error if I run, say,
ipfs pin add ...
while theipfs daemon
is still initialising:I was about to add some logic to backoff and retry in my Ansible playbook when it occurred to me that the
ipfs
CLI itself could do implement this and become easier to script this sort of usage.I propose that instead of failing immediately the
ipfs
CLI should display a warning and then wait for the lock to become available. The warning could be displayed periodically, perhaps every 10s. I imagine my use case might look something like this:In this session the lock was not available for somewhere between 30-40s. I would expect the warnings to be written to STDERR so as not to interfere with tools which may rely on the output of the CLI's STDOUT.
The text was updated successfully, but these errors were encountered: