{"action":"created","issue":{"url":"https://api.github.com/repos/coreos/etcd/issues/2994","labels_url":"https://api.github.com/repos/coreos/etcd/issues/2994/labels{/name}","comments_url":"https://api.github.com/repos/coreos/etcd/issues/2994/comments","events_url":"https://api.github.com/repos/coreos/etcd/issues/2994/events","html_url":"https://github.com/coreos/etcd/pull/2994","id":88812439,"number":2994,"title":"proxy: handle canceled proxy request gracefully","user":{"login":"webner","id":1425746,"avatar_url":"https://avatars.githubusercontent.com/u/1425746?v=3","gravatar_id":"","url":"https://api.github.com/users/webner","html_url":"https://github.com/webner","followers_url":"https://api.github.com/users/webner/followers","following_url":"https://api.github.com/users/webner/following{/other_user}","gists_url":"https://api.github.com/users/webner/gists{/gist_id}","starred_url":"https://api.github.com/users/webner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webner/subscriptions","organizations_url":"https://api.github.com/users/webner/orgs","repos_url":"https://api.github.com/users/webner/repos","events_url":"https://api.github.com/users/webner/events{/privacy}","received_events_url":"https://api.github.com/users/webner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-16T19:07:44Z","updated_at":"2015-06-22T22:24:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/coreos/etcd/pulls/2994","html_url":"https://github.com/coreos/etcd/pull/2994","diff_url":"https://github.com/coreos/etcd/pull/2994.diff","patch_url":"https://github.com/coreos/etcd/pull/2994.patch"},"body":"when a client of the proxy server cancels a request the proxy should not set the endpoint state to unavailable.\r\n\r\n**the problem**\r\nif a client closes the connection to the proxy and the proxy request is canceled than the current and all remaining endpoints will be set to unavailable.\r\n\r\n**steps to reproduce**\r\ngoreman start\r\n\r\nexecute following script\r\n```\r\n#!/bin/bash\r\nexport ETCDCTL_PEERS=http://localhost:8080\r\n\r\nfor i in $(seq 1 10); do \r\n    etcdctl --no-sync set /test $i &\r\n    PID=$!\r\n    sleep 0.00$i\r\n    kill -SIGKILL $PID\r\ndone\r\n```\r\n\r\noutput of script\r\n```\r\netcd :: (master*) » ./kill-proxy                                                                                                                                                   ~/Go/src/github.com/webner/etcd  \r\nError:  502:  (unhandled http status [Service Unavailable] with body [{\"message\":\"proxy: zero endpoints currently available\"}]) [0]\r\n./kill-proxy: line 4: 25843 Killed                  etcdctl --no-sync set /test $i\r\nError:  502:  (unhandled http status [Service Unavailable] with body [{\"message\":\"proxy: zero endpoints currently available\"}]) [0]\r\n./kill-proxy: line 8: kill: (25852) - No such process\r\nError:  502:  (unhandled http status [Service Unavailable] with body [{\"message\":\"proxy: zero endpoints currently available\"}]) [0]\r\n./kill-proxy: line 8: kill: (25857) - No such process\r\nError:  502:  (unhandled http status [Service Unavailable] with body [{\"message\":\"proxy: zero endpoints currently available\"}]) [0]\r\n./kill-proxy: line 8: kill: (25862) - No such process\r\nError:  502:  (unhandled http status [Service Unavailable] with body [{\"message\":\"proxy: zero endpoints currently available\"}]) [0]\r\n./kill-proxy: line 8: kill: (25867) - No such process\r\n```\r\nand output of proxy log\r\n```\r\n20:57:39 proxy | 2015/06/16 20:57:39 proxy: zero endpoints currently available\r\n20:57:39 proxy | 2015/06/16 20:57:39 proxy: zero endpoints currently available\r\n20:57:39 proxy | 2015/06/16 20:57:39 proxy: zero endpoints currently available\r\n20:57:39 proxy | 2015/06/16 20:57:39 proxy: zero endpoints currently available\r\n20:57:39 proxy | 2015/06/16 20:57:39 proxy: zero endpoints currently available\r\n20:57:39 proxy | 2015/06/16 20:57:39 proxy: zero endpoints currently available\r\n```\r\n\r\n**expected result**\r\n```\r\n21:06:01 proxy | 2015/06/16 21:06:01 proxy: request from 127.0.0.1:45189 canceled\r\n21:06:01 proxy | 2015/06/16 21:06:01 proxy: request from 127.0.0.1:45190 canceled\r\n21:06:01 proxy | 2015/06/16 21:06:01 proxy: request from 127.0.0.1:45192 canceled\r\n21:06:01 proxy | 2015/06/16 21:06:01 proxy: request from 127.0.0.1:45194 canceled\r\n21:06:01 proxy | 2015/06/16 21:06:01 proxy: request from 127.0.0.1:45196 canceled\r\n21:06:01 proxy | 2015/06/16 21:06:01 proxy: request from 127.0.0.1:45198 canceled\r\n21:06:01 proxy | 2015/06/16 21:06:01 proxy: request from 127.0.0.1:45200 canceled\r\n21:06:01 proxy | 2015/06/16 21:06:01 proxy: request from 127.0.0.1:45202 canceled\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/coreos/etcd/issues/comments/114285937","html_url":"https://github.com/coreos/etcd/pull/2994#issuecomment-114285937","issue_url":"https://api.github.com/repos/coreos/etcd/issues/2994","id":114285937,"user":{"login":"yichengq","id":2976232,"avatar_url":"https://avatars.githubusercontent.com/u/2976232?v=3","gravatar_id":"","url":"https://api.github.com/users/yichengq","html_url":"https://github.com/yichengq","followers_url":"https://api.github.com/users/yichengq/followers","following_url":"https://api.github.com/users/yichengq/following{/other_user}","gists_url":"https://api.github.com/users/yichengq/gists{/gist_id}","starred_url":"https://api.github.com/users/yichengq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yichengq/subscriptions","organizations_url":"https://api.github.com/users/yichengq/orgs","repos_url":"https://api.github.com/users/yichengq/repos","events_url":"https://api.github.com/users/yichengq/events{/privacy}","received_events_url":"https://api.github.com/users/yichengq/received_events","type":"User","site_admin":false},"created_at":"2015-06-22T22:24:32Z","updated_at":"2015-06-22T22:24:32Z","body":"lgtm."}}