{"action":"created","issue":{"url":"https://api.github.com/repos/purescript/pursuit/issues/108","labels_url":"https://api.github.com/repos/purescript/pursuit/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/purescript/pursuit/issues/108/comments","events_url":"https://api.github.com/repos/purescript/pursuit/issues/108/events","html_url":"https://github.com/purescript/pursuit/issues/108","id":94419758,"number":108,"title":"Locking to avoid multiple concurrent Hoogle DB regens","user":{"login":"hdgarrood","id":1270186,"avatar_url":"https://avatars.githubusercontent.com/u/1270186?v=3","gravatar_id":"","url":"https://api.github.com/users/hdgarrood","html_url":"https://github.com/hdgarrood","followers_url":"https://api.github.com/users/hdgarrood/followers","following_url":"https://api.github.com/users/hdgarrood/following{/other_user}","gists_url":"https://api.github.com/users/hdgarrood/gists{/gist_id}","starred_url":"https://api.github.com/users/hdgarrood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdgarrood/subscriptions","organizations_url":"https://api.github.com/users/hdgarrood/orgs","repos_url":"https://api.github.com/users/hdgarrood/repos","events_url":"https://api.github.com/users/hdgarrood/events{/privacy}","received_events_url":"https://api.github.com/users/hdgarrood/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-11T00:44:08Z","updated_at":"2015-07-11T00:45:46Z","closed_at":null,"body":"At the moment, we could theoretically have many Hoogle database regenerations happening concurrently, as any search request that happens during a regeneration will trigger another one.\r\n\r\nSome kind of locking mechanism (an `MVar ()` in the App data type, perhaps?) could help avoid this.\r\n\r\nI think we should perhaps wait until this is causing issues on the server before actually implementing this, though. Currently, regeneration only takes around 5 seconds. When we switch to Hoogle 5, it should be even faster, as we will be able to avoid a `String` roundtrip."},"comment":{"url":"https://api.github.com/repos/purescript/pursuit/issues/comments/120556882","html_url":"https://github.com/purescript/pursuit/issues/108#issuecomment-120556882","issue_url":"https://api.github.com/repos/purescript/pursuit/issues/108","id":120556882,"user":{"login":"paf31","id":630306,"avatar_url":"https://avatars.githubusercontent.com/u/630306?v=3","gravatar_id":"","url":"https://api.github.com/users/paf31","html_url":"https://github.com/paf31","followers_url":"https://api.github.com/users/paf31/followers","following_url":"https://api.github.com/users/paf31/following{/other_user}","gists_url":"https://api.github.com/users/paf31/gists{/gist_id}","starred_url":"https://api.github.com/users/paf31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paf31/subscriptions","organizations_url":"https://api.github.com/users/paf31/orgs","repos_url":"https://api.github.com/users/paf31/repos","events_url":"https://api.github.com/users/paf31/events{/privacy}","received_events_url":"https://api.github.com/users/paf31/received_events","type":"User","site_admin":false},"created_at":"2015-07-11T00:45:46Z","updated_at":"2015-07-11T00:45:46Z","body":"Why is it that a search triggers a regen right now?\r\n\r\nI think an `MVar` sounds fine if we can't avoid regenerating the DB. "}}