As part of improving code coverage for http2 in #14985, I wrote some unit tests for socket operations in #16211 I noticed that: - `socketOnResume` returns `this.pause()` if `this._paused` is true https://github.com/nodejs/node/blob/411695e1d26565c7498992be19731bbea6b6aa58/lib/internal/http2/core.js#L2180-L2181 - if `this._paused` is true, it's set to false in `socketOnDrain` https://github.com/nodejs/node/blob/411695e1d26565c7498992be19731bbea6b6aa58/lib/internal/http2/core.js#L2198 However, I didn't find any code which sets socket._paused to true https://github.com/nodejs/node/search?utf8=%E2%9C%93&q=_paused&type= Is this a bug? Or is there a way to mock value of `socket._paused` while testing?
Activity
apapirovski commentedon Oct 15, 2017
cc @jasnell — this seems like an incomplete implementation or a bug, any insight into what the original thinking was?
trivikr commentedon Oct 15, 2017
For reference, initial commit which introduced
_paused: nodejs/http2@4e47406trivikr commentedon Oct 17, 2017
This issue is likely to be irrelevant if socket operations are removed in #16252
Fishrock123 commentedon Oct 20, 2017
Isn't this part of the streams implementation?
apapirovski commentedon Oct 20, 2017
@Fishrock123 as far as I can tell it's custom to _http_server.js
trivikr commentedon Oct 23, 2017
The
socketOn*methods are being removed in #16330This issue will cease to exist when the PR is merged.
apapirovski commentedon Oct 25, 2017
We still have unused
stream._pausedbut this issue isn't addressing that so I'm closing since the PR removing this just landed.