{"action":"created","issue":{"url":"https://api.github.com/repos/henrylee2cn/pholcus/issues/50","repository_url":"https://api.github.com/repos/henrylee2cn/pholcus","labels_url":"https://api.github.com/repos/henrylee2cn/pholcus/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/henrylee2cn/pholcus/issues/50/comments","events_url":"https://api.github.com/repos/henrylee2cn/pholcus/issues/50/events","html_url":"https://github.com/henrylee2cn/pholcus/issues/50","id":242047047,"number":50,"title":"反馈一个bug，日志达到一定条数后会协程会卡死","user":{"login":"lxslove","id":3477277,"avatar_url":"https://avatars1.githubusercontent.com/u/3477277?v=4","gravatar_id":"","url":"https://api.github.com/users/lxslove","html_url":"https://github.com/lxslove","followers_url":"https://api.github.com/users/lxslove/followers","following_url":"https://api.github.com/users/lxslove/following{/other_user}","gists_url":"https://api.github.com/users/lxslove/gists{/gist_id}","starred_url":"https://api.github.com/users/lxslove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lxslove/subscriptions","organizations_url":"https://api.github.com/users/lxslove/orgs","repos_url":"https://api.github.com/users/lxslove/repos","events_url":"https://api.github.com/users/lxslove/events{/privacy}","received_events_url":"https://api.github.com/users/lxslove/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-11T13:27:17Z","updated_at":"2017-08-05T12:49:05Z","closed_at":null,"body":"经过长时间的采集图片后，发现到后来内存剧增，并大量goroutine存在，加了一些日志做跟踪，发现协程在输出完文件后，就在日志那里卡住了，导致图片的内存无法释放\r\n1.代码如下，加了些日志：\r\n![ww6lkno7qtvj u23y1 1i2c](https://user-images.githubusercontent.com/3477277/28070365-34be2758-667f-11e7-8bf7-7faa9b3b838d.png)\r\n\r\n2.日志如下：\r\n![fk w lm4qm59pbs vgorfy](https://user-images.githubusercontent.com/3477277/28070375-4060f19e-667f-11e7-9b32-4ede48766bf7.png)\r\n\r\n3.堆栈跟踪如下：\r\n![ldb8_8cyy3kws4_baz45fto](https://user-images.githubusercontent.com/3477277/28070388-4a03c406-667f-11e7-8137-9b59ef42d4ef.png)\r\n\r\n4.根本原因，是在单机模式时，照样向socketlog推送了日志，导致日志channel爆满。这里应该加个判断是否为client模式\r\n![g xzfhe04ry s2i27bqw0](https://user-images.githubusercontent.com/3477277/28070410-67e460d4-667f-11e7-95eb-7db993849942.png)\r\n\r\n![image](https://user-images.githubusercontent.com/3477277/28070426-712dc00e-667f-11e7-824e-2845f6d46ba4.png)\r\n\r\n而bl.steal这个chennel是client模式下，client发送给server的channel，在单机模式下没有从chennel获取数据，这个channel只有在client模式下才能被读取到\r\n![lptfbf 1f7_n lmiilf18rs](https://user-images.githubusercontent.com/3477277/28070476-a3d1f584-667f-11e7-9140-3962d81dd7a5.png)\r\n\r\n![93g2iybwi uf4 6 y ukxt](https://user-images.githubusercontent.com/3477277/28070486-a8fd970c-667f-11e7-8ae1-7ef1260be79a.png)\r\n\r\n\r\n![t i5377o g b3ehms_ 4](https://user-images.githubusercontent.com/3477277/28070492-ad933d12-667f-11e7-81ab-566c2d058961.png)\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/henrylee2cn/pholcus/issues/comments/320441933","html_url":"https://github.com/henrylee2cn/pholcus/issues/50#issuecomment-320441933","issue_url":"https://api.github.com/repos/henrylee2cn/pholcus/issues/50","id":320441933,"user":{"login":"henrylee2cn","id":10174178,"avatar_url":"https://avatars3.githubusercontent.com/u/10174178?v=4","gravatar_id":"","url":"https://api.github.com/users/henrylee2cn","html_url":"https://github.com/henrylee2cn","followers_url":"https://api.github.com/users/henrylee2cn/followers","following_url":"https://api.github.com/users/henrylee2cn/following{/other_user}","gists_url":"https://api.github.com/users/henrylee2cn/gists{/gist_id}","starred_url":"https://api.github.com/users/henrylee2cn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henrylee2cn/subscriptions","organizations_url":"https://api.github.com/users/henrylee2cn/orgs","repos_url":"https://api.github.com/users/henrylee2cn/repos","events_url":"https://api.github.com/users/henrylee2cn/events{/privacy}","received_events_url":"https://api.github.com/users/henrylee2cn/received_events","type":"User","site_admin":false},"created_at":"2017-08-05T12:49:05Z","updated_at":"2017-08-05T12:49:05Z","body":"感谢你的详尽分析，我马上做跟踪，并解决该问题"}}
{"actor":{"display_login":"henrylee2cn"}}