- Notifications
You must be signed in to change notification settings - Fork 53
feat: supports serialization of options#97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Conversation
waitingsong commented Feb 13, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
waitingsong commented Feb 13, 2020
codecovbot commented Feb 13, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Codecov Report
@@ Coverage Diff @@## master #97 +/- ## ========================================== + Coverage 98.82% 98.83% +0.01% ========================================== Files 8 8 Lines 511 517 +6 ========================================== + Hits 505 511 +6 Misses 6 6 Continue to review full report at Codecov.
|
96f73a0 to 23fc7b3Comparewaitingsong commented Feb 13, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
另,是否需要在 debug 模式时默认设置为 |
120bebe to 0eba33bCompare0eba33b to e9d9069Comparee9d9069 to 9d9f33aCompare| | require |`Array\|String`| will inject into worker/agent process | | ||
| | pidFile |`String`| will save master pid to this file | | ||
| |[serialization]| `json|advanced` | default: 'json'. 'advanced' requires Node.js >= 10.16.0 | | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是 12.16.0 吧?
waitingsongFeb 14, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
另,是否需要在 debug 模式时默认设置为
advanced值?
或者当 >= 12.16.0 时全部默认 'advanced'?我看了下下面的相关讨论:nodejs/node#30162 (comment), 看起来
advanced并不是所有场景下都是最优解,所以这里确实应该 follow 上游的设置,默认为 'json',但是在框架里在适当的版本暴露可配置选项。
我也是如此考虑:随着版本更新性能提升及可靠性得到进一步验证,可能在未来某个版本默认改为 advanced。
所以跟随 node.js 默认设置(json),代码里面不做默认值设置,让有需要的用户自行决定传入参数控制。
Uh oh!
There was an error while loading. Please reload this page.
lib/master.js Outdated
| if(this.options.isDebug)opt.execArgv=process.execArgv.concat([`--${semver.gte(process.version,'8.0.0') ? 'inspect' : 'debug'}-port=${debugPort}`]); | ||
| /* istanbul ignore next */ | ||
| if(semver.gte(process.version,'12.16.0')){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的判断有一个问题,'v13.0.0' 也是 >= 12.16.0,但是这个版本 patch 了此功能么
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对于 12 版本是 >= 12.16.0, 对于 13 版本是 >= 13.2.0。
代码已更新判断条件。
Uh oh!
There was an error while loading. Please reload this page.
hyj1991 left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感谢您关于 v12.16.0 更新的支持更多 IPC 序列/反序列化的配置参数 PR,以上是我的一些对于 PR 代码的修改建议,期望可以一起针对修改/不修改的合理性进行讨论 :)
hyj1991 commented Feb 14, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
我看了下下面的相关讨论:nodejs/node#30162 (comment), 看起来 |
atian25 commented Feb 14, 2020
如果这个未来还会变化的话,那目前能否先通过 NODE_OPTIONS ENV 的方式来使用就好了? |
>= v12.16.0 < v13.0.0, or >= v13.2.0
4179e83 to 1249d64Comparewaitingsong commented Feb 14, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
这个变量设置是否影响 forkAgentWorker() 对 agent 进程的派生。 |
atian25 commented Feb 14, 2020
影响的,fork 默认是继承 env 的。可以试验下 |
waitingsong commented Feb 14, 2020
就是说不修改代码,通过设置 ENV 也能起效果。那我关闭这个 PR 了哟? |
atian25 commented Feb 14, 2020
我理解是这样的,你实验下看看 |
waitingsong commented Feb 14, 2020
那我测试下。 |
hyj1991 commented Feb 18, 2020 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
所以这个 PR 还有下文不。。。 |
waitingsong commented Feb 18, 2020
么时间测试啊,我先关掉。 |
ref: https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V12.md#advanced-serialization-for-ipc
Checklist
npm testpassesAffected core subsystem(s)
Description of change