{"action":"created","issue":{"url":"https://api.github.com/repos/derbyparty/racer-highway/issues/8","repository_url":"https://api.github.com/repos/derbyparty/racer-highway","labels_url":"https://api.github.com/repos/derbyparty/racer-highway/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/derbyparty/racer-highway/issues/8/comments","events_url":"https://api.github.com/repos/derbyparty/racer-highway/issues/8/events","html_url":"https://github.com/derbyparty/racer-highway/issues/8","id":127405013,"number":8,"title":"Лишние слушатели","user":{"login":"plusbpm","id":428403,"avatar_url":"https://avatars.githubusercontent.com/u/428403?v=3","gravatar_id":"","url":"https://api.github.com/users/plusbpm","html_url":"https://github.com/plusbpm","followers_url":"https://api.github.com/users/plusbpm/followers","following_url":"https://api.github.com/users/plusbpm/following{/other_user}","gists_url":"https://api.github.com/users/plusbpm/gists{/gist_id}","starred_url":"https://api.github.com/users/plusbpm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plusbpm/subscriptions","organizations_url":"https://api.github.com/users/plusbpm/orgs","repos_url":"https://api.github.com/users/plusbpm/repos","events_url":"https://api.github.com/users/plusbpm/events{/privacy}","received_events_url":"https://api.github.com/users/plusbpm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-19T09:37:56Z","updated_at":"2016-04-21T08:12:59Z","closed_at":null,"body":"Не понятно назначение этого слушателя:\r\nhttps://github.com/derbyparty/racer-highway/blob/master/lib/server/index.js#L150\r\n\r\nbackend никогда не вызывает событие connect, более того, он не даже не слушает события share agent\r\nзато при каждом подключении вешается новый слушатель, а старый не снимается (нет обработки disconnect)\r\nв итоге получаем:\r\n\r\n```\r\n(node) warning: possible EventEmitter memory leak detected. 11 connect listeners added. Use emitter.setMaxListeners() to increase limit.\r\nTrace\r\n    at Backend.addListener (events.js:239:17)\r\n    at doneInitialization (/home/user/someproject/public_html/node_modules/racer-highway/lib/server/index.js:150:11)\r\n    at WebSocketServer.<anonymous> (/home/user/someproject/public_html/node_modules/racer-highway/lib/server/index.js:101:5)\r\n    at emitOne (events.js:77:13)\r\n    at WebSocketServer.emit (events.js:169:7)\r\n    at /home/user/someproject/public_html/node_modules/racer-highway/lib/server/index.js:121:13\r\n    at completeHybiUpgrade2 (/home/user/someproject/public_html/node_modules/racer-highway/node_modules/ws/lib/WebSocketServer.js:237:5)\r\n    at completeHybiUpgrade1 (/home/user/someproject/public_html/node_modules/racer-highway/node_modules/ws/lib/WebSocketServer.js:262:13)\r\n    at WebSocketServer.handleHybiUpgrade (/home/user/someproject/public_html/node_modules/racer-highway/node_modules/ws/lib/WebSocketServer.js:290:3)\r\n    at WebSocketServer.handleUpgrade (/home/user/someproject/public_html/node_modules/racer-highway/node_modules/ws/lib/WebSocketServer.js:147:26)\r\n    at next (/home/user/someproject/public_html/node_modules/racer-highway/lib/server/index.js:119:11)\r\n    at MongoStore.<anonymous> (/home/user/someproject/public_html/node_modules/express-session/index.js:432:7)\r\n    at MongoStore.tryCatcher (/home/user/someproject/public_html/node_modules/connect-mongo/node_modules/bluebird/js/release/util.js:11:23)\r\n    at Promise.successAdapter [as _fulfillmentHandler0] (/home/user/someproject/public_html/node_modules/connect-mongo/node_modules/bluebird/js/release/nodeify.js:23:30)\r\n    at Promise._settlePromise (/home/user/someproject/public_html/node_modules/connect-mongo/node_modules/bluebird/js/release/promise.js:543:21)\r\n    at Promise._settlePromise0 (/home/user/someproject/public_html/node_modules/connect-mongo/node_modules/bluebird/js/release/promise.js:591:10)\r\n```\r\n\r\nможет я чего то не знаю ?"},"comment":{"url":"https://api.github.com/repos/derbyparty/racer-highway/issues/comments/212798638","html_url":"https://github.com/derbyparty/racer-highway/issues/8#issuecomment-212798638","issue_url":"https://api.github.com/repos/derbyparty/racer-highway/issues/8","id":212798638,"user":{"login":"plusbpm","id":428403,"avatar_url":"https://avatars.githubusercontent.com/u/428403?v=3","gravatar_id":"","url":"https://api.github.com/users/plusbpm","html_url":"https://github.com/plusbpm","followers_url":"https://api.github.com/users/plusbpm/followers","following_url":"https://api.github.com/users/plusbpm/following{/other_user}","gists_url":"https://api.github.com/users/plusbpm/gists{/gist_id}","starred_url":"https://api.github.com/users/plusbpm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plusbpm/subscriptions","organizations_url":"https://api.github.com/users/plusbpm/orgs","repos_url":"https://api.github.com/users/plusbpm/repos","events_url":"https://api.github.com/users/plusbpm/events{/privacy}","received_events_url":"https://api.github.com/users/plusbpm/received_events","type":"User","site_admin":false},"created_at":"2016-04-21T08:12:58Z","updated_at":"2016-04-21T08:12:58Z","body":"No, the problem at the level of transport, subscriptions to documents has nothing to do with it.\r\nI used the transport in a single project, but first remove these extra lines, without them normally works."}}