{"action":"created","issue":{"url":"https://api.github.com/repos/wtsi-hgi/cookie-monster/issues/4","labels_url":"https://api.github.com/repos/wtsi-hgi/cookie-monster/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/wtsi-hgi/cookie-monster/issues/4/comments","events_url":"https://api.github.com/repos/wtsi-hgi/cookie-monster/issues/4/events","html_url":"https://github.com/wtsi-hgi/cookie-monster/issues/4","id":124953622,"number":4,"title":"Processor may process the same cookie in parallel","user":{"login":"colin-nolan","id":1138107,"avatar_url":"https://avatars.githubusercontent.com/u/1138107?v=3","gravatar_id":"","url":"https://api.github.com/users/colin-nolan","html_url":"https://github.com/colin-nolan","followers_url":"https://api.github.com/users/colin-nolan/followers","following_url":"https://api.github.com/users/colin-nolan/following{/other_user}","gists_url":"https://api.github.com/users/colin-nolan/gists{/gist_id}","starred_url":"https://api.github.com/users/colin-nolan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/colin-nolan/subscriptions","organizations_url":"https://api.github.com/users/colin-nolan/orgs","repos_url":"https://api.github.com/users/colin-nolan/repos","events_url":"https://api.github.com/users/colin-nolan/events{/privacy}","received_events_url":"https://api.github.com/users/colin-nolan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/wtsi-hgi/cookie-monster/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-05T12:00:45Z","updated_at":"2016-01-05T13:00:46Z","closed_at":null,"body":"`CookieJar` does not prevent the same cookie from being processed in parallel. This can lead to the same cookie enrichment to be loaded (a potentially very expensive operation!) more than once. "},"comment":{"url":"https://api.github.com/repos/wtsi-hgi/cookie-monster/issues/comments/168992333","html_url":"https://github.com/wtsi-hgi/cookie-monster/issues/4#issuecomment-168992333","issue_url":"https://api.github.com/repos/wtsi-hgi/cookie-monster/issues/4","id":168992333,"user":{"login":"Xophmeister","id":384987,"avatar_url":"https://avatars.githubusercontent.com/u/384987?v=3","gravatar_id":"","url":"https://api.github.com/users/Xophmeister","html_url":"https://github.com/Xophmeister","followers_url":"https://api.github.com/users/Xophmeister/followers","following_url":"https://api.github.com/users/Xophmeister/following{/other_user}","gists_url":"https://api.github.com/users/Xophmeister/gists{/gist_id}","starred_url":"https://api.github.com/users/Xophmeister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Xophmeister/subscriptions","organizations_url":"https://api.github.com/users/Xophmeister/orgs","repos_url":"https://api.github.com/users/Xophmeister/repos","events_url":"https://api.github.com/users/Xophmeister/events{/privacy}","received_events_url":"https://api.github.com/users/Xophmeister/received_events","type":"User","site_admin":false},"created_at":"2016-01-05T13:00:46Z","updated_at":"2016-01-05T13:00:46Z","body":"Once a cookie has been returned by `get_next_for_processing`, it is marked as in progress in the underlying database. Once this is set, it is dropped from the queue and it's not possible to get at it directly. The only way you could process the same cookie concurrently is if you *purposely* coded it in such a way:\r\n\r\n```python\r\nfoo = cookiejar.get_next_for_processing()\r\nif foo:\r\n    process_in_background(foo, some_callback)\r\n    process_in_background(foo, some_callback)\r\n```\r\n\r\n...which you wouldn't do."}}