fix: remove clear timing && skip keep-alive after 12.19.0#4497
Merged
fix: remove clear timing && skip keep-alive after 12.19.0#4497
Conversation
c071c77 to
76ddf1a
Compare
atian25
commented
Oct 19, 2020
| // Node.js >=14.8.0 will set Keep-Alive Header, see https://github.com/nodejs/node/pull/34561 | ||
| const shouldPatchKeepAliveHeader = semver.lt(process.version, '14.8.0'); | ||
| // Node.js >=14.8.0 and >= 12.19.0 will set Keep-Alive Header, see https://github.com/nodejs/node/pull/34561 | ||
| const shouldPatchKeepAliveHeader = !semver.satisfies('>=14.8.0 || ^12.19.0'); |
Member
Author
There was a problem hiding this comment.
这里有一个隐藏问题(14.8.0 和 12.19.0 有一个 floor 的 bug),但没有完美解。
如果用户设置为 12001,且 Node 是 14.8.0 的话,会出现 2 种情况:
- keep-alive 被同时设置为 2 个值: timeout=12.001, timeout=12
- keep-alive 只被设置为:timeout=12.001
此处选择了后者,因为一般不会设置为非标准值。
killagu
reviewed
Oct 19, 2020
| fs.writeFileSync(dumpFile, CircularJSON.stringify(json, null, 2)); | ||
| this.timing.clear(); | ||
| this.timing.disable(); | ||
| setTimeout(() => this.timing.clear(), 3000); |
Contributor
There was a problem hiding this comment.
这么加不太行,如果 agent 在 serverDidReady 里去读取,很有可能是读不到的。
Member
Author
There was a problem hiding this comment.
那还是改为默认不清理吧,只是 disable 禁止新增
fengmk2
approved these changes
Oct 19, 2020
b2b6b35 to
5ce9dd3
Compare
5ce9dd3 to
f8dc6c6
Compare
Codecov Report
@@ Coverage Diff @@
## master #4497 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 34 34
Lines 1113 1112 -1
Branches 183 183
=========================================
- Hits 1113 1112 -1
Continue to review full report at Codecov.
|
popomore
pushed a commit
that referenced
this pull request
Oct 19, 2020
fix: remove clear timing && skip keep-alive after 12.19.0 (#4497)
qingdengyue
pushed a commit
to VioletLife/egg
that referenced
this pull request
Dec 24, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
npm testpassesAffected core subsystem(s)
Description of change