{"action":"created","issue":{"url":"https://api.github.com/repos/mediocregopher/radix.v2/issues/57","repository_url":"https://api.github.com/repos/mediocregopher/radix.v2","labels_url":"https://api.github.com/repos/mediocregopher/radix.v2/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/mediocregopher/radix.v2/issues/57/comments","events_url":"https://api.github.com/repos/mediocregopher/radix.v2/issues/57/events","html_url":"https://github.com/mediocregopher/radix.v2/issues/57","id":221500631,"number":57,"title":"an error like \"use of closed network connection\" occured when using the sentienl of  radix.v2","user":{"login":"panjf2000","id":7496278,"avatar_url":"https://avatars1.githubusercontent.com/u/7496278?v=3","gravatar_id":"","url":"https://api.github.com/users/panjf2000","html_url":"https://github.com/panjf2000","followers_url":"https://api.github.com/users/panjf2000/followers","following_url":"https://api.github.com/users/panjf2000/following{/other_user}","gists_url":"https://api.github.com/users/panjf2000/gists{/gist_id}","starred_url":"https://api.github.com/users/panjf2000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/panjf2000/subscriptions","organizations_url":"https://api.github.com/users/panjf2000/orgs","repos_url":"https://api.github.com/users/panjf2000/repos","events_url":"https://api.github.com/users/panjf2000/events{/privacy}","received_events_url":"https://api.github.com/users/panjf2000/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-04-13T09:00:33Z","updated_at":"2017-04-17T18:58:09Z","closed_at":null,"body":"i have a program which would run ten goroutines to pop up messages from redis,\r\n\r\nand this program run well at the beginning, but after running for some time, it would get a error EOF\r\n\r\nand all goroutines would get an error \"write tcp xx.xx.xx.xx:25252->xx.xx.xx.xx:7239: use of closed network \r\nconnection\" when reading a message from redis in these codes: redisClient.Cmd(\"RPOP\", p.queue).Bytes()\r\n\r\nhow can i fix this issue?"},"comment":{"url":"https://api.github.com/repos/mediocregopher/radix.v2/issues/comments/294559865","html_url":"https://github.com/mediocregopher/radix.v2/issues/57#issuecomment-294559865","issue_url":"https://api.github.com/repos/mediocregopher/radix.v2/issues/57","id":294559865,"user":{"login":"mediocregopher","id":933154,"avatar_url":"https://avatars3.githubusercontent.com/u/933154?v=3","gravatar_id":"","url":"https://api.github.com/users/mediocregopher","html_url":"https://github.com/mediocregopher","followers_url":"https://api.github.com/users/mediocregopher/followers","following_url":"https://api.github.com/users/mediocregopher/following{/other_user}","gists_url":"https://api.github.com/users/mediocregopher/gists{/gist_id}","starred_url":"https://api.github.com/users/mediocregopher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediocregopher/subscriptions","organizations_url":"https://api.github.com/users/mediocregopher/orgs","repos_url":"https://api.github.com/users/mediocregopher/repos","events_url":"https://api.github.com/users/mediocregopher/events{/privacy}","received_events_url":"https://api.github.com/users/mediocregopher/received_events","type":"User","site_admin":false},"created_at":"2017-04-17T18:58:09Z","updated_at":"2017-04-17T18:58:09Z","body":"> why don't you do the same thing to every single redis connection?\r\n\r\nThe `pool` package doesn't currently do this because I wanted the implementation to be the absolute simplest and smallest it could be, and doing this would add a whole extra go-routine to it. It also made the close semantics a bit weird, since currently the method is called `Empty` which doesn't imply that the go-routine would be stopped.\r\n\r\nOn the other hand, so many people have asked for it at this point I'm really thinking about just doing it.\r\n\r\nIn the meantime, you should be able to do the following:\r\n\r\n```\r\ngo func() {\r\n\tfor {\r\n\t\ttime.Sleep(1 * time.Second)\r\n\t\tconn, err := client.GetMaster(\"master\")\r\n\t\tif err != nil {\r\n\t\t\t// log if you want\r\n\t\t\tcontinue\r\n\t\t}\r\n\t\tconn.Cmd(\"PING\")\r\n\t\tclient.PutMaster(\"master\", conn)\r\n\t}\r\n}\r\n```\r\n\r\nand it would do roughly the same thing that the snippet you posted does, but with a sentinel client.\r\n"}}
{"actor":{"display_login":"mediocregopher"}}