{"action":"created","issue":{"url":"https://api.github.com/repos/borgbackup/borg/issues/773","repository_url":"https://api.github.com/repos/borgbackup/borg","labels_url":"https://api.github.com/repos/borgbackup/borg/issues/773/labels{/name}","comments_url":"https://api.github.com/repos/borgbackup/borg/issues/773/comments","events_url":"https://api.github.com/repos/borgbackup/borg/issues/773/events","html_url":"https://github.com/borgbackup/borg/issues/773","id":142070032,"number":773,"title":"borg client waiting forever to acquire the lock","user":{"login":"jperville","id":834791,"avatar_url":"https://avatars.githubusercontent.com/u/834791?v=3","gravatar_id":"","url":"https://api.github.com/users/jperville","html_url":"https://github.com/jperville","followers_url":"https://api.github.com/users/jperville/followers","following_url":"https://api.github.com/users/jperville/following{/other_user}","gists_url":"https://api.github.com/users/jperville/gists{/gist_id}","starred_url":"https://api.github.com/users/jperville/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jperville/subscriptions","organizations_url":"https://api.github.com/users/jperville/orgs","repos_url":"https://api.github.com/users/jperville/repos","events_url":"https://api.github.com/users/jperville/events{/privacy}","received_events_url":"https://api.github.com/users/jperville/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-19T15:15:17Z","updated_at":"2016-03-19T19:53:20Z","closed_at":null,"body":"I have been experimenting with borg 1.0.0 and I am wondering how locking is supposed to work.\r\n\r\nI have 2 computers being backed up to the same shared repository over SSH (eg. 192.168.0.1:/var/tmp/mybackup').\r\n\r\nEach client is run like this: `borg create --lock-wait=10000 [lots of --excludes] 192.168.0.1:/var/tmp/mybackup::$(hostname)-$(date '+%Y-%m-%d_%H:%M:%S' ) /`\r\n\r\nWhen I start backup at the same time on all clients, only 1 client can start the backup and the others are waiting on the lock. So far so good. But when the first client finishes its backup then I expect the next client to acquire the lock yet all stay stuck waiting on the lock!\r\n\r\nHere is what `ps aux | grep borg` displays on the backup server:\r\n```sh\r\nroot@backupserver:/etc# ps aux | grep borg\r\nroot     19833  0.0  0.0  93012 27412 ?        Ss   15:46   0:00 /usr/bin/python3 /usr/local/bin/borg serve --umask=077 --info\r\n```\r\n\r\nI have to CTRL-C the waiting clients then restart them manually; then again only the first to acquire the lock can complete, all other clients stay stuck.\r\n\r\nWorse, the 'borg serve' processes on the server keep running, even after I CTRL-C out of the clients.\r\n\r\nAm I doing anything wrong?"},"comment":{"url":"https://api.github.com/repos/borgbackup/borg/issues/comments/198776910","html_url":"https://github.com/borgbackup/borg/issues/773#issuecomment-198776910","issue_url":"https://api.github.com/repos/borgbackup/borg/issues/773","id":198776910,"user":{"login":"ThomasWaldmann","id":356103,"avatar_url":"https://avatars.githubusercontent.com/u/356103?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasWaldmann","html_url":"https://github.com/ThomasWaldmann","followers_url":"https://api.github.com/users/ThomasWaldmann/followers","following_url":"https://api.github.com/users/ThomasWaldmann/following{/other_user}","gists_url":"https://api.github.com/users/ThomasWaldmann/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasWaldmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasWaldmann/subscriptions","organizations_url":"https://api.github.com/users/ThomasWaldmann/orgs","repos_url":"https://api.github.com/users/ThomasWaldmann/repos","events_url":"https://api.github.com/users/ThomasWaldmann/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasWaldmann/received_events","type":"User","site_admin":false},"created_at":"2016-03-19T19:53:20Z","updated_at":"2016-03-19T19:53:20Z","body":"Guess the stacktrace is misleading. At the time when the FileExistsError occurred, the lock dir really existed. In the exception handler (for file exists == lock dir exists), there is a sleep - which you interrupted with Ctrl-C (when the lock dir was already gone).\r\n\r\nFrom the code:\r\n```\r\n sleep = timeout / 10.0\r\n```\r\n\r\nLikely that was not the best idea in general.\r\nFor your timeout time of 10.000 s, this means a sleep time of 1000s.\r\n\r\nSo, likely it is not stuck, you'ld just need to observe it for ~1000s.\r\n"}}