{"action":"created","issue":{"url":"https://api.github.com/repos/ServiceStack/Issues/issues/391","labels_url":"https://api.github.com/repos/ServiceStack/Issues/issues/391/labels{/name}","comments_url":"https://api.github.com/repos/ServiceStack/Issues/issues/391/comments","events_url":"https://api.github.com/repos/ServiceStack/Issues/issues/391/events","html_url":"https://github.com/ServiceStack/Issues/issues/391","id":126695357,"number":391,"title":"Service stop responding after dropped SSE connections (Only on Linux)","user":{"login":"REDDOXX","id":7371417,"avatar_url":"https://avatars.githubusercontent.com/u/7371417?v=3","gravatar_id":"","url":"https://api.github.com/users/REDDOXX","html_url":"https://github.com/REDDOXX","followers_url":"https://api.github.com/users/REDDOXX/followers","following_url":"https://api.github.com/users/REDDOXX/following{/other_user}","gists_url":"https://api.github.com/users/REDDOXX/gists{/gist_id}","starred_url":"https://api.github.com/users/REDDOXX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/REDDOXX/subscriptions","organizations_url":"https://api.github.com/users/REDDOXX/orgs","repos_url":"https://api.github.com/users/REDDOXX/repos","events_url":"https://api.github.com/users/REDDOXX/events{/privacy}","received_events_url":"https://api.github.com/users/REDDOXX/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-14T16:46:02Z","updated_at":"2016-01-14T23:54:27Z","closed_at":"2016-01-14T17:17:24Z","body":"We have this issue since more than a year, but it took a really long time to found the real reason.\r\nAfter ~1000 dropped SSE connections the service will not longer respond to any connection at all.\r\n\r\nIt took some time but now i was able to provide you a sample to reproduce this issue.\r\nThe problem only occurs on Linux, and you can reproduce it with any version of Mono incl. 4.2.1\r\n\r\nI made a sample project on Github with detailed description. So you should be able to to reproduce the issue very fast. Hopefully you find a way to fix this issue, because it provides an easy way to DDoS a ServiceStack service with SSE.\r\n\r\nYou can find the Sample-Project on Github:\r\nhttps://github.com/REDDOXX/ServiceStack-SSE-Issue\r\n\r\nAlex\r\n"},"comment":{"url":"https://api.github.com/repos/ServiceStack/Issues/issues/comments/171820816","html_url":"https://github.com/ServiceStack/Issues/issues/391#issuecomment-171820816","issue_url":"https://api.github.com/repos/ServiceStack/Issues/issues/391","id":171820816,"user":{"login":"mythz","id":89361,"avatar_url":"https://avatars.githubusercontent.com/u/89361?v=3","gravatar_id":"","url":"https://api.github.com/users/mythz","html_url":"https://github.com/mythz","followers_url":"https://api.github.com/users/mythz/followers","following_url":"https://api.github.com/users/mythz/following{/other_user}","gists_url":"https://api.github.com/users/mythz/gists{/gist_id}","starred_url":"https://api.github.com/users/mythz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mythz/subscriptions","organizations_url":"https://api.github.com/users/mythz/orgs","repos_url":"https://api.github.com/users/mythz/repos","events_url":"https://api.github.com/users/mythz/events{/privacy}","received_events_url":"https://api.github.com/users/mythz/received_events","type":"User","site_admin":false},"created_at":"2016-01-14T23:54:27Z","updated_at":"2016-01-14T23:54:27Z","body":"I'm seeing leaking sockets reported in a few places for Mono, e.g: https://github.com/SignalR/SignalR/issues/3161\r\n\r\nThat thread mentions a potential workaround by setting `HttpListener.IgnoreWriteExceptions`. Can you change your AppHost to include:\r\n\r\n```csharp\r\npublic override ServiceStackHost Start(string urlBase)\r\n{\r\n    base.Start(urlBase);\r\n    Listener.IgnoreWriteExceptions = true;\r\n    return this;\r\n}\r\n```\r\n\r\nCan you let me know if that helps?\r\n\r\nI've managed to exceed 2000+ connections killed with `./kill-connections.sh` with this enabled. Note I've modified it to `COUNT_PER_SEC=1`.\r\n\r\nIncidentally `./monitor.sh` is always reporting:\r\n\r\n    0 leaked connections found.\r\n\r\nBut when I did `lsof -p $PID` on its own I was able to see a growing number of `(CLOSED)` sockets initially, but stopped growing after `IgnoreWriteExceptions=true`.\r\n\r\nI'm running this on OSX El Capitan 10.11.2 (15C50) / Mono 4.2.1"}}