{"action":"created","issue":{"url":"https://api.github.com/repos/coreos/etcd/issues/6922","repository_url":"https://api.github.com/repos/coreos/etcd","labels_url":"https://api.github.com/repos/coreos/etcd/issues/6922/labels{/name}","comments_url":"https://api.github.com/repos/coreos/etcd/issues/6922/comments","events_url":"https://api.github.com/repos/coreos/etcd/issues/6922/events","html_url":"https://github.com/coreos/etcd/issues/6922","id":193173225,"number":6922,"title":"client: user may freeze on KeepAlive","user":{"login":"dennwc","id":676724,"avatar_url":"https://avatars.githubusercontent.com/u/676724?v=3","gravatar_id":"","url":"https://api.github.com/users/dennwc","html_url":"https://github.com/dennwc","followers_url":"https://api.github.com/users/dennwc/followers","following_url":"https://api.github.com/users/dennwc/following{/other_user}","gists_url":"https://api.github.com/users/dennwc/gists{/gist_id}","starred_url":"https://api.github.com/users/dennwc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennwc/subscriptions","organizations_url":"https://api.github.com/users/dennwc/orgs","repos_url":"https://api.github.com/users/dennwc/repos","events_url":"https://api.github.com/users/dennwc/events{/privacy}","received_events_url":"https://api.github.com/users/dennwc/received_events","type":"User","site_admin":false},"labels":[{"id":46697272,"url":"https://api.github.com/repos/coreos/etcd/labels/kind/bug","name":"kind/bug","color":"ff0000","default":false}],"state":"closed","locked":false,"assignee":{"login":"heyitsanthony","id":16294350,"avatar_url":"https://avatars.githubusercontent.com/u/16294350?v=3","gravatar_id":"","url":"https://api.github.com/users/heyitsanthony","html_url":"https://github.com/heyitsanthony","followers_url":"https://api.github.com/users/heyitsanthony/followers","following_url":"https://api.github.com/users/heyitsanthony/following{/other_user}","gists_url":"https://api.github.com/users/heyitsanthony/gists{/gist_id}","starred_url":"https://api.github.com/users/heyitsanthony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heyitsanthony/subscriptions","organizations_url":"https://api.github.com/users/heyitsanthony/orgs","repos_url":"https://api.github.com/users/heyitsanthony/repos","events_url":"https://api.github.com/users/heyitsanthony/events{/privacy}","received_events_url":"https://api.github.com/users/heyitsanthony/received_events","type":"User","site_admin":false},"assignees":[{"login":"heyitsanthony","id":16294350,"avatar_url":"https://avatars.githubusercontent.com/u/16294350?v=3","gravatar_id":"","url":"https://api.github.com/users/heyitsanthony","html_url":"https://github.com/heyitsanthony","followers_url":"https://api.github.com/users/heyitsanthony/followers","following_url":"https://api.github.com/users/heyitsanthony/following{/other_user}","gists_url":"https://api.github.com/users/heyitsanthony/gists{/gist_id}","starred_url":"https://api.github.com/users/heyitsanthony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heyitsanthony/subscriptions","organizations_url":"https://api.github.com/users/heyitsanthony/orgs","repos_url":"https://api.github.com/users/heyitsanthony/repos","events_url":"https://api.github.com/users/heyitsanthony/events{/privacy}","received_events_url":"https://api.github.com/users/heyitsanthony/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/coreos/etcd/milestones/30","html_url":"https://github.com/coreos/etcd/milestone/30","labels_url":"https://api.github.com/repos/coreos/etcd/milestones/30/labels","id":1735265,"number":30,"title":"v3.1.0","description":"Proxy!","creator":{"login":"xiang90","id":4479947,"avatar_url":"https://avatars.githubusercontent.com/u/4479947?v=3","gravatar_id":"","url":"https://api.github.com/users/xiang90","html_url":"https://github.com/xiang90","followers_url":"https://api.github.com/users/xiang90/followers","following_url":"https://api.github.com/users/xiang90/following{/other_user}","gists_url":"https://api.github.com/users/xiang90/gists{/gist_id}","starred_url":"https://api.github.com/users/xiang90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiang90/subscriptions","organizations_url":"https://api.github.com/users/xiang90/orgs","repos_url":"https://api.github.com/users/xiang90/repos","events_url":"https://api.github.com/users/xiang90/events{/privacy}","received_events_url":"https://api.github.com/users/xiang90/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":128,"state":"open","created_at":"2016-04-27T23:53:02Z","updated_at":"2016-12-07T08:05:14Z","due_on":"2016-12-31T00:00:00Z","closed_at":null},"comments":6,"created_at":"2016-12-02T17:30:52Z","updated_at":"2016-12-14T21:46:10Z","closed_at":"2016-12-07T08:05:14Z","body":"**etcd client version:** `3.1.0-rc.0` (git hash: 83347907)\r\n\r\n**Issue can be reproduced in following way:**\r\n1) Create an etcdv3 client.\r\n2) Make `lessor.recvKeepAliveLoop()` fail with any server-side error (we got `\"lease: unknown error(not a primary lessor )\"`).\r\n3) Create a new lease.\r\n4) Try to keep it alive with `KeepAlive`.\r\n\r\n**Expected behavior:**\r\nWe expected client to recover from `recvKeepAliveLoop` error after some time and continue to process leases. Alternatively we expected `KeepAlive` to return error immediately due to broken `recvKeepAliveLoop`, so we can restart client manually, at least.\r\n\r\n**Observed behavior:**\r\nUser of `KeepAlive` freezes because returned channel is never closed, after `keepAliveCtxCloser` exits on [`<-l.donec`](https://github.com/coreos/etcd/blob/83347907774bf36cbb261c594a32fd7b0f5dd9f6/clientv3/lease.go#L275) case in select due to `recvKeepAliveLoop` [signal](https://github.com/coreos/etcd/blob/83347907774bf36cbb261c594a32fd7b0f5dd9f6/clientv3/lease.go#L333). User code assumes that keep alive still works and expects responses or close of the channel, but none of these events happens.\r\n\r\n**Side notes**\r\nWe used `concurrency.Session` to control the lease, and in this case it leads to [goroutine leak](https://github.com/coreos/etcd/blob/83347907774bf36cbb261c594a32fd7b0f5dd9f6/clientv3/concurrency/session.go#L59) and freeze of `session.Close` (or more precisely [session.Orphan](https://github.com/coreos/etcd/blob/83347907774bf36cbb261c594a32fd7b0f5dd9f6/clientv3/concurrency/session.go#L84))."},"comment":{"url":"https://api.github.com/repos/coreos/etcd/issues/comments/267166628","html_url":"https://github.com/coreos/etcd/issues/6922#issuecomment-267166628","issue_url":"https://api.github.com/repos/coreos/etcd/issues/6922","id":267166628,"user":{"login":"heyitsanthony","id":16294350,"avatar_url":"https://avatars.githubusercontent.com/u/16294350?v=3","gravatar_id":"","url":"https://api.github.com/users/heyitsanthony","html_url":"https://github.com/heyitsanthony","followers_url":"https://api.github.com/users/heyitsanthony/followers","following_url":"https://api.github.com/users/heyitsanthony/following{/other_user}","gists_url":"https://api.github.com/users/heyitsanthony/gists{/gist_id}","starred_url":"https://api.github.com/users/heyitsanthony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heyitsanthony/subscriptions","organizations_url":"https://api.github.com/users/heyitsanthony/orgs","repos_url":"https://api.github.com/users/heyitsanthony/repos","events_url":"https://api.github.com/users/heyitsanthony/events{/privacy}","received_events_url":"https://api.github.com/users/heyitsanthony/received_events","type":"User","site_admin":false},"created_at":"2016-12-14T21:46:10Z","updated_at":"2016-12-14T21:46:10Z","body":"Wouldn't it be the same path? If the lease interface is closed iff donec is closed. If the keepalive loop gets a halting error, donec is closed so the interface is effectively closed as well."}}
{"actor":{"display_login":"heyitsanthony"}}