{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/566","labels_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/566/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/566/comments","events_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/566/events","html_url":"https://github.com/aspnet/KestrelHttpServer/issues/566","id":125723088,"number":566,"title":"Consider behavior when a client disconnects","user":{"login":"rynowak","id":1430011,"avatar_url":"https://avatars.githubusercontent.com/u/1430011?v=3","gravatar_id":"","url":"https://api.github.com/users/rynowak","html_url":"https://github.com/rynowak","followers_url":"https://api.github.com/users/rynowak/followers","following_url":"https://api.github.com/users/rynowak/following{/other_user}","gists_url":"https://api.github.com/users/rynowak/gists{/gist_id}","starred_url":"https://api.github.com/users/rynowak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rynowak/subscriptions","organizations_url":"https://api.github.com/users/rynowak/orgs","repos_url":"https://api.github.com/users/rynowak/repos","events_url":"https://api.github.com/users/rynowak/events{/privacy}","received_events_url":"https://api.github.com/users/rynowak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-09T00:27:46Z","updated_at":"2016-01-09T03:33:02Z","closed_at":null,"body":"Currently today it's *possible* that you'll get I/O exceptions due to a client disconnect, but it's pretty hard to reason about exactly when that will happen and when it won't due to buffering. \r\n\r\nThese exceptions can be troublesome in production because you didn't do anything wrong to cause them, and can't do anything to handle or prevent them. Now they are popping up in logs, and you have to try to reason about what's an actual bug vs an I/O exception due to disconnection.\r\n\r\n------------\r\n\r\nThe proposal is that we provide a cancellation token for client disconnection that you can pass if you want to know about cancellation, and that the server by default would just ignore your output once a socket is closed.\r\n\r\nRough idea is that this token would be part of the connection feature, and not surfaced through `HttpContext` because it's so advanced."},"comment":{"url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/comments/170186505","html_url":"https://github.com/aspnet/KestrelHttpServer/issues/566#issuecomment-170186505","issue_url":"https://api.github.com/repos/aspnet/KestrelHttpServer/issues/566","id":170186505,"user":{"login":"benaadams","id":1142958,"avatar_url":"https://avatars.githubusercontent.com/u/1142958?v=3","gravatar_id":"","url":"https://api.github.com/users/benaadams","html_url":"https://github.com/benaadams","followers_url":"https://api.github.com/users/benaadams/followers","following_url":"https://api.github.com/users/benaadams/following{/other_user}","gists_url":"https://api.github.com/users/benaadams/gists{/gist_id}","starred_url":"https://api.github.com/users/benaadams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benaadams/subscriptions","organizations_url":"https://api.github.com/users/benaadams/orgs","repos_url":"https://api.github.com/users/benaadams/repos","events_url":"https://api.github.com/users/benaadams/events{/privacy}","received_events_url":"https://api.github.com/users/benaadams/received_events","type":"User","site_admin":false},"created_at":"2016-01-09T03:33:02Z","updated_at":"2016-01-09T03:33:02Z","body":"Related https://github.com/aspnet/WebSockets/issues/63"}}