mirror of
https://github.com/ElemeFE/node-interview.git
synced 2026-01-18 16:12:44 +00:00
Formate text.
This commit is contained in:
parent
f95ee2b450
commit
f07866cdb0
@ -215,10 +215,15 @@ Node.js 中的 `http.Agent` 用于池化 HTTP 客户端请求的 socket (pooling
|
||||
另外最近发现一个 Agent 坑爹的地方, 使用node 版本为 6.8.1(包括)到6.10(不包括)时会出现此问题。当 keepAlive 为 true 或者长时间大量请求时, 一旦设置了 request timeout 的话,由于 socket 一直未销毁, socket 添加了 timeout 事件,但是在请求完成以后没有清除事件,导致事件重复监听,且事件闭包引用了 req,导致内存泄漏。
|
||||
|
||||
想了解详细情况的话,可以查看一下讨论链接。
|
||||
|
||||
[socket 复用情况讨论](https://github.com/ElemeFE/node-interview/issues/19)
|
||||
|
||||
[此bug 讨论 issue](https://github.com/nodejs/node/issues/9268)
|
||||
|
||||
[引入此 bug 的 commit](https://github.com/nodejs/node/blob/ee7af01b93cc46f1848f6962ad2d6c93f319341a/lib/_http_client.js#L565)
|
||||
|
||||
[解决此 bug 的 pr](https://github.com/nodejs/node/pull/9440/files)
|
||||
|
||||
(本组的同学有在整理这方面的文章, 请期待)
|
||||
|
||||
### socket hang up
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user