-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix: don't log when rawPacket is empty #2924
Conversation
test/lib/cluster/app_worker.test.js
Outdated
@@ -91,6 +95,16 @@ describe('test/lib/cluster/app_worker.test.js', () => { | |||
test2.request().path = '/foo bar'; | |||
await test2.expect(DEFAULT_BAD_REQUEST_HTML).expect(400); | |||
}); | |||
|
|||
it.only('should not log when there is no rawPacket', done => { | |||
const socket = net.createConnection({ port: app.port }, () => { |
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.
模拟不出来,等 @XadillaX 看看
Codecov Report
@@ Coverage Diff @@
## master #2924 +/- ##
==========================================
+ Coverage 99.75% 99.75% +<.01%
==========================================
Files 29 29
Lines 825 826 +1
==========================================
+ Hits 823 824 +1
Misses 2 2
Continue to review full report at Codecov.
|
其实 onClientError 异常不需要关注,互联网上大量无效请求,忽略就好。 |
要区分的,之前就是遇到线上问题才打印出来的。 |
我的意思是 onClientError 就不要打印异常日志了。 |
lib/application.js
Outdated
err.code, | ||
err.message); | ||
} else { | ||
console.error(123123, '============================='); |
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.
123?
module.exports = app => { | ||
let server; | ||
app.on('server', srv => { server = srv; }); |
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.
好像默认已经挂到 app.server 了
35ef403
to
d986505
Compare
d986505
to
1b152e5
Compare
ci fail |
test/lib/cluster/app_worker.test.js
Outdated
@@ -62,13 +64,14 @@ describe('test/lib/cluster/app_worker.test.js', () => { | |||
]); | |||
}); | |||
|
|||
describe('customized client error', () => { | |||
describe.only('customized client error', () => { |
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.
only
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.
我在测这个 ci
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.
travis 有一个 debug 模式,好像可以 ssh 上去搞
fix: don't log when rawPacket is empty (#2924)
Checklist
npm test
passesAffected core subsystem(s)
Description of change