{"action":"created","issue":{"url":"https://api.github.com/repos/arobson/rabbot/issues/7","repository_url":"https://api.github.com/repos/arobson/rabbot","labels_url":"https://api.github.com/repos/arobson/rabbot/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/arobson/rabbot/issues/7/comments","events_url":"https://api.github.com/repos/arobson/rabbot/issues/7/events","html_url":"https://github.com/arobson/rabbot/pull/7","id":147849087,"number":7,"title":"Clean up failed subscription when publishing in exchangeFsm","user":{"login":"rniemeyer","id":412468,"avatar_url":"https://avatars.githubusercontent.com/u/412468?v=3","gravatar_id":"","url":"https://api.github.com/users/rniemeyer","html_url":"https://github.com/rniemeyer","followers_url":"https://api.github.com/users/rniemeyer/followers","following_url":"https://api.github.com/users/rniemeyer/following{/other_user}","gists_url":"https://api.github.com/users/rniemeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/rniemeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rniemeyer/subscriptions","organizations_url":"https://api.github.com/users/rniemeyer/orgs","repos_url":"https://api.github.com/users/rniemeyer/repos","events_url":"https://api.github.com/users/rniemeyer/events{/privacy}","received_events_url":"https://api.github.com/users/rniemeyer/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-04-12T19:26:14Z","updated_at":"2016-04-14T15:34:37Z","closed_at":"2016-04-12T20:10:30Z","pull_request":{"url":"https://api.github.com/repos/arobson/rabbot/pulls/7","html_url":"https://github.com/arobson/rabbot/pull/7","diff_url":"https://github.com/arobson/rabbot/pull/7.diff","patch_url":"https://github.com/arobson/rabbot/pull/7.patch"},"body":"Tracked down a source of a memory leak to a failed subscription that was not released in all scenarios."},"comment":{"url":"https://api.github.com/repos/arobson/rabbot/issues/comments/210005929","html_url":"https://github.com/arobson/rabbot/pull/7#issuecomment-210005929","issue_url":"https://api.github.com/repos/arobson/rabbot/issues/7","id":210005929,"user":{"login":"brandonpsmith","id":2806503,"avatar_url":"https://avatars.githubusercontent.com/u/2806503?v=3","gravatar_id":"","url":"https://api.github.com/users/brandonpsmith","html_url":"https://github.com/brandonpsmith","followers_url":"https://api.github.com/users/brandonpsmith/followers","following_url":"https://api.github.com/users/brandonpsmith/following{/other_user}","gists_url":"https://api.github.com/users/brandonpsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonpsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonpsmith/subscriptions","organizations_url":"https://api.github.com/users/brandonpsmith/orgs","repos_url":"https://api.github.com/users/brandonpsmith/repos","events_url":"https://api.github.com/users/brandonpsmith/events{/privacy}","received_events_url":"https://api.github.com/users/brandonpsmith/received_events","type":"User","site_admin":false},"created_at":"2016-04-14T15:34:37Z","updated_at":"2016-04-14T15:34:37Z","body":"Shouldn't the timeout also unsubscribe? Looks like the leak could still happen if publishes are timing out. Of course, if all the publishes are timing out, there are other problems. Something like this may fix it ...\r\n\r\n```javascript\r\ntimeout = setTimeout( function() {\r\n  timedOut = true;\r\n  onRejected.bind( this )( new Error( \"Publish took longer than configured timeout\" ) );\r\n}.bind( this ), publishTimeout );\r\n```"}}