{"action":"created","issue":{"url":"https://api.github.com/repos/bsm/sarama-cluster/issues/20","repository_url":"https://api.github.com/repos/bsm/sarama-cluster","labels_url":"https://api.github.com/repos/bsm/sarama-cluster/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/bsm/sarama-cluster/issues/20/comments","events_url":"https://api.github.com/repos/bsm/sarama-cluster/issues/20/events","html_url":"https://github.com/bsm/sarama-cluster/issues/20","id":128237774,"number":20,"title":"panic: close of closed channel","user":{"login":"jdness","id":1036099,"avatar_url":"https://avatars3.githubusercontent.com/u/1036099?v=3","gravatar_id":"","url":"https://api.github.com/users/jdness","html_url":"https://github.com/jdness","followers_url":"https://api.github.com/users/jdness/followers","following_url":"https://api.github.com/users/jdness/following{/other_user}","gists_url":"https://api.github.com/users/jdness/gists{/gist_id}","starred_url":"https://api.github.com/users/jdness/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdness/subscriptions","organizations_url":"https://api.github.com/users/jdness/orgs","repos_url":"https://api.github.com/users/jdness/repos","events_url":"https://api.github.com/users/jdness/events{/privacy}","received_events_url":"https://api.github.com/users/jdness/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-01-22T20:25:08Z","updated_at":"2017-04-21T18:17:27Z","closed_at":"2016-01-25T11:48:56Z","body":"Yesterday we upgraded to Kafka 0.9 and the latest Sarama library. We are using sarama-cluster to distribute/rebalance our four kafka running instances. This morning, two of our four daemon instances crashed with \"panic: close of closed channel\". I haven't been able to reproduce it yet but here is what I see in the logs:\n\n[Sarama] 2016/01/22 07:47:29 client/metadata fetching metadata for all topics from broker localhost:9092\n[Sarama] 2016/01/22 07:49:03 cluster/consumer -a9899ac7-1b49-40cf-848d-bb843b7231d7 rebalance\n2016/01/22 07:49:03 kafka server: The provided member is not known in the current generation.\n[Sarama] 2016/01/22 07:49:03 client/coordinator requesting coordinator for consumergoup backend from localhost:9092\n[Sarama] 2016/01/22 07:49:03 client/coordinator coordinator for consumergoup backend is #0 (services.veramine.com:9092)\n[Sarama] 2016/01/22 07:49:03 consumer/broker/2 disconnecting due to error processing FetchRequest: read tcp 192.168.10.4:54970->192.168.10.4:9094: i/o timeout\n[Sarama] 2016/01/22 07:49:03 Closed connection to broker services.veramine.com:9094\n2016/01/22 07:49:03 kafka: 1 errors while consuming\n[Sarama] 2016/01/22 07:49:03 cluster/consumer -a9899ac7-1b49-40cf-848d-bb843b7231d7 rebalance\n[Sarama] 2016/01/22 07:49:03 client/coordinator requesting coordinator for consumergoup backend from localhost:9092\n[Sarama] 2016/01/22 07:49:03 client/coordinator coordinator for consumergoup backend is #0 (services.veramine.com:9092)\npanic: close of closed channel\n\nThe close came from gopkg.in/bsm/sarama-cluster%2ev2.(*partitionConsumer).Close(0xcb3d2d8d20, 0x0, 0x0)\n\nHere's the code there:\n\nfunc (c *partitionConsumer) Close() (err error) {\n        close(c.dying)\n        <-c.dead\n\n```\n    if e := c.pcm.Close(); e != nil {\n            err = e\n    }\n    return\n```\n\n}\n\nIs it possible to first check the partitionConsumer to see if it is already closed before closing, or do you think something needs to be done on sarama side to avoid a panic? I figured that even if a kafka instance died, eventually a rebalance would accomodate that so I'd rather not panic.  Thanks!\n\nJonathan\n"},"comment":{"url":"https://api.github.com/repos/bsm/sarama-cluster/issues/comments/296265217","html_url":"https://github.com/bsm/sarama-cluster/issues/20#issuecomment-296265217","issue_url":"https://api.github.com/repos/bsm/sarama-cluster/issues/20","id":296265217,"user":{"login":"dim","id":16614,"avatar_url":"https://avatars2.githubusercontent.com/u/16614?v=3","gravatar_id":"","url":"https://api.github.com/users/dim","html_url":"https://github.com/dim","followers_url":"https://api.github.com/users/dim/followers","following_url":"https://api.github.com/users/dim/following{/other_user}","gists_url":"https://api.github.com/users/dim/gists{/gist_id}","starred_url":"https://api.github.com/users/dim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dim/subscriptions","organizations_url":"https://api.github.com/users/dim/orgs","repos_url":"https://api.github.com/users/dim/repos","events_url":"https://api.github.com/users/dim/events{/privacy}","received_events_url":"https://api.github.com/users/dim/received_events","type":"User","site_admin":false},"created_at":"2017-04-21T18:17:27Z","updated_at":"2017-04-21T18:17:27Z","body":"Sarama's default is 250ms. Looks like some of your messages take longer than 100ms to process. Great to hear that it's working"}}
{"actor":{"display_login":"dim"}}