{"action":"created","issue":{"url":"https://api.github.com/repos/ocaml/opam/issues/2259","labels_url":"https://api.github.com/repos/ocaml/opam/issues/2259/labels{/name}","comments_url":"https://api.github.com/repos/ocaml/opam/issues/2259/comments","events_url":"https://api.github.com/repos/ocaml/opam/issues/2259/events","html_url":"https://github.com/ocaml/opam/issues/2259","id":95665130,"number":2259,"title":"Lock while switch install","user":{"login":"Drup","id":801124,"avatar_url":"https://avatars.githubusercontent.com/u/801124?v=3","gravatar_id":"","url":"https://api.github.com/users/Drup","html_url":"https://github.com/Drup","followers_url":"https://api.github.com/users/Drup/followers","following_url":"https://api.github.com/users/Drup/following{/other_user}","gists_url":"https://api.github.com/users/Drup/gists{/gist_id}","starred_url":"https://api.github.com/users/Drup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Drup/subscriptions","organizations_url":"https://api.github.com/users/Drup/orgs","repos_url":"https://api.github.com/users/Drup/repos","events_url":"https://api.github.com/users/Drup/events{/privacy}","received_events_url":"https://api.github.com/users/Drup/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-07-17T14:16:56Z","updated_at":"2015-07-18T02:57:09Z","closed_at":null,"body":"The lock during switch compilation feels a bit overly restrictive. \r\n- It is impossible to install in another switch\r\n- It is impossible to read anything (list, show ..)\r\n\r\nThis is the case even for `opam switch install --no-switch`."},"comment":{"url":"https://api.github.com/repos/ocaml/opam/issues/comments/122476911","html_url":"https://github.com/ocaml/opam/issues/2259#issuecomment-122476911","issue_url":"https://api.github.com/repos/ocaml/opam/issues/2259","id":122476911,"user":{"login":"AltGr","id":807966,"avatar_url":"https://avatars.githubusercontent.com/u/807966?v=3","gravatar_id":"","url":"https://api.github.com/users/AltGr","html_url":"https://github.com/AltGr","followers_url":"https://api.github.com/users/AltGr/followers","following_url":"https://api.github.com/users/AltGr/following{/other_user}","gists_url":"https://api.github.com/users/AltGr/gists{/gist_id}","starred_url":"https://api.github.com/users/AltGr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AltGr/subscriptions","organizations_url":"https://api.github.com/users/AltGr/orgs","repos_url":"https://api.github.com/users/AltGr/repos","events_url":"https://api.github.com/users/AltGr/events{/privacy}","received_events_url":"https://api.github.com/users/AltGr/received_events","type":"User","site_admin":false},"created_at":"2015-07-18T02:57:09Z","updated_at":"2015-07-18T02:57:09Z","body":"The finer-grained idea would have:\r\n 1. low-level file locks that just prevent a file to be read while it's being written. The write lock is only kept while the file is being written, _i.e._ very shortly. The reading process should be able to pass after some delay and a retry, without the user even noticing.\r\n 2. longer-term locks that mean that the file is going to be written by a running process, and can't be written or similarly locked by another process.\r\n\r\nThe interface for 2. and writing could be something like:\r\n```\r\nval read_and_lock: filename -> t * locked_file\r\n\r\nval write: locked_file -> t -> unit\r\n```\r\nThe first function might create an empty locked file if not existing, or this could be done by another function..."}}