{"action":"created","issue":{"url":"https://api.github.com/repos/rstudio/rstudio/issues/526","labels_url":"https://api.github.com/repos/rstudio/rstudio/issues/526/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/rstudio/issues/526/comments","events_url":"https://api.github.com/repos/rstudio/rstudio/issues/526/events","html_url":"https://github.com/rstudio/rstudio/pull/526","id":114943625,"number":526,"title":"[WIP] use directories for atomic file locking","user":{"login":"kevinushey","id":1976582,"avatar_url":"https://avatars.githubusercontent.com/u/1976582?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinushey","html_url":"https://github.com/kevinushey","followers_url":"https://api.github.com/users/kevinushey/followers","following_url":"https://api.github.com/users/kevinushey/following{/other_user}","gists_url":"https://api.github.com/users/kevinushey/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinushey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinushey/subscriptions","organizations_url":"https://api.github.com/users/kevinushey/orgs","repos_url":"https://api.github.com/users/kevinushey/repos","events_url":"https://api.github.com/users/kevinushey/events{/privacy}","received_events_url":"https://api.github.com/users/kevinushey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-11-04T00:44:24Z","updated_at":"2015-11-06T18:56:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rstudio/rstudio/pulls/526","html_url":"https://github.com/rstudio/rstudio/pull/526","diff_url":"https://github.com/rstudio/rstudio/pull/526.diff","patch_url":"https://github.com/rstudio/rstudio/pull/526.patch"},"body":"Probably not quite ready for merge, but ready for review.\r\n\r\n-----\r\n\r\nThis PR moves away from advisory-based locks (as used with `boost::filesystem::file_lock`) and instead implements a locking mechanism using directory creation + the so-called 'dead-mans switch'.\r\n\r\nIn this scheme, the lockfile unit is a directory, and the lock is considered active if:\r\n\r\n1. It exists, and\r\n2. The file is less than 30 seconds old.\r\n\r\nWe implement (as @jmcphers called it) the 'dead-mans switch', where a separate thread keeps track of, and 'marks', all active locks. Every 20 seconds, the thread updates the last modified time of the active locks, guaranteeing that any active locks remain 'alive' while they are locked."},"comment":{"url":"https://api.github.com/repos/rstudio/rstudio/issues/comments/154500939","html_url":"https://github.com/rstudio/rstudio/pull/526#issuecomment-154500939","issue_url":"https://api.github.com/repos/rstudio/rstudio/issues/526","id":154500939,"user":{"login":"kevinushey","id":1976582,"avatar_url":"https://avatars.githubusercontent.com/u/1976582?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinushey","html_url":"https://github.com/kevinushey","followers_url":"https://api.github.com/users/kevinushey/followers","following_url":"https://api.github.com/users/kevinushey/following{/other_user}","gists_url":"https://api.github.com/users/kevinushey/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinushey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinushey/subscriptions","organizations_url":"https://api.github.com/users/kevinushey/orgs","repos_url":"https://api.github.com/users/kevinushey/repos","events_url":"https://api.github.com/users/kevinushey/events{/privacy}","received_events_url":"https://api.github.com/users/kevinushey/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T18:56:42Z","updated_at":"2015-11-06T18:56:42Z","body":"Okay, testing with the current implementation seems to work across the board (my previous error was not using a unique thread ID in the proxy lockfile; thanks to @aronatkins for catching that)."}}