{"action":"closed","issue":{"url":"https://api.github.com/repos/gocolly/colly/issues/160","repository_url":"https://api.github.com/repos/gocolly/colly","labels_url":"https://api.github.com/repos/gocolly/colly/issues/160/labels{/name}","comments_url":"https://api.github.com/repos/gocolly/colly/issues/160/comments","events_url":"https://api.github.com/repos/gocolly/colly/issues/160/events","html_url":"https://github.com/gocolly/colly/issues/160","id":329146778,"node_id":"MDU6SXNzdWUzMjkxNDY3Nzg=","number":160,"title":"Race condition with collector queue ","user":{"login":"roscopecoltran","id":24416962,"node_id":"MDQ6VXNlcjI0NDE2OTYy","avatar_url":"https://avatars1.githubusercontent.com/u/24416962?v=4","gravatar_id":"","url":"https://api.github.com/users/roscopecoltran","html_url":"https://github.com/roscopecoltran","followers_url":"https://api.github.com/users/roscopecoltran/followers","following_url":"https://api.github.com/users/roscopecoltran/following{/other_user}","gists_url":"https://api.github.com/users/roscopecoltran/gists{/gist_id}","starred_url":"https://api.github.com/users/roscopecoltran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roscopecoltran/subscriptions","organizations_url":"https://api.github.com/users/roscopecoltran/orgs","repos_url":"https://api.github.com/users/roscopecoltran/repos","events_url":"https://api.github.com/users/roscopecoltran/events{/privacy}","received_events_url":"https://api.github.com/users/roscopecoltran/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-04T17:23:48Z","updated_at":"2018-06-05T08:16:45Z","closed_at":"2018-06-05T08:16:45Z","author_association":"NONE","body":"Hi guys,\r\n\r\nWhen I run the queue example with `go run -race main.go`, I have the following error:\r\n\r\n```bash\r\n==================\r\nWARNING: DATA RACE\r\nRead at 0x00c4202639c0 by goroutine 7:\r\n  github.com/sniperkit/colly/pkg/queue.(*InMemoryQueueStorage).QueueSize()\r\n      /Users/sniperkit/local/golang/src/github.com/sniperkit/colly/pkg/queue/queue.go:209 +0x3c\r\n  github.com/sniperkit/colly/pkg/queue.(*Queue).Size()\r\n      /Users/sniperkit/local/golang/src/github.com/sniperkit/colly/pkg/queue/queue.go:114 +0x57\r\n  github.com/sniperkit/colly/pkg/queue.(*Queue).IsEmpty()\r\n      /Users/sniperkit/local/golang/src/github.com/sniperkit/colly/pkg/queue/queue.go:73 +0x38\r\n  github.com/sniperkit/colly/pkg/queue.(*Queue).Run.func1()\r\n      /Users/sniperkit/local/golang/src/github.com/sniperkit/colly/pkg/queue/queue.go:126 +0x7d\r\n\r\nPrevious write at 0x00c4202639c0 by goroutine 6:\r\n  github.com/sniperkit/colly/pkg/queue.(*InMemoryQueueStorage).GetRequest()\r\n      /Users/sniperkit/local/golang/src/github.com/sniperkit/colly/pkg/queue/queue.go:203 +0x193\r\n  github.com/sniperkit/colly/pkg/queue.(*Queue).Run.func1()\r\n      /Users/sniperkit/local/golang/src/github.com/sniperkit/colly/pkg/queue/queue.go:140 +0xd8\r\n\r\nGoroutine 7 (running) created at:\r\n  github.com/sniperkit/colly/pkg/queue.(*Queue).Run()\r\n      /Users/sniperkit/local/golang/src/github.com/sniperkit/colly/pkg/queue/queue.go:123 +0xb6\r\n  main.main()\r\n      /Users/sniperkit/local/golang/src/github.com/sniperkit/colly/_examples/generic/colly-queue/main.go:39 +0x364\r\n\r\nGoroutine 6 (running) created at:\r\n  github.com/sniperkit/colly/pkg/queue.(*Queue).Run()\r\n      /Users/sniperkit/local/golang/src/github.com/sniperkit/colly/pkg/queue/queue.go:123 +0xb6\r\n  main.main()\r\n      /Users/sniperkit/local/golang/src/github.com/sniperkit/colly/_examples/generic/colly-queue/main.go:39 +0x364\r\n==================\r\nvisiting https://httpbin.org/delay/1?n=0\r\nvisiting https://httpbin.org/delay/1?n=1\r\n```\r\n\r\nAny idea on how to solve this data race condition ?\r\n\r\nCheers,"}}
{"actor":{"display_login":"asciimoo"}}