-
Notifications
You must be signed in to change notification settings - Fork 29
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
[WIP] FIX migrate MongoDB driver to 4.x #689
base: master
Are you sure you want to change the base?
Conversation
fgalan
commented
Jun 21, 2022
•
edited
Loading
edited
- check lost of log fields (correlator, etc.) in some log messages
test/component/db_test.js
Outdated
@@ -27,15 +27,19 @@ var should = require('should'), | |||
utilsT = require('../utils/utilsT'), | |||
db = require('../../lib/db'); | |||
|
|||
describe('Db', function() { | |||
xdescribe('Db', function() { |
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.
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.
Question was answered. Based on it, fixed in 5be543e
It seems that log information is lost in some cases Eg. rulesStore.Save: Now (nok): time=2022-06-21T11:48:37.285Z | lvl=INFO | corr=n/a | trans=n/a | op=n/a | msg=rulesStore.Save "{"acknowledged":true,"insertedId":"62b1b015e5c73b549bb684f0"}" In master (ok) time=2022-06-21T11:48:23.903Z | lvl=INFO | corr=b994265e-8e22-40de-9a9c-70822a9ab136; node=iswEc9mAeN; perseocep=0 | trans=b994265e-8e22-40de-9a9c-70822a9ab136 | op=/rules | path=/rules | comp=perseo-fe | srv=unknownt | subsrv=/ | from=::ffff:127.0.0.1 | msg=rulesStore.Save "{"result":{"n":1,"ok":1},"connection":{"id":4,"host":"localhost","port":27017},"ops":[{"name":"Blood","text":"select *,\"Bloo [...]" |
At the present moment, only some tests in the test/metrics/metrics_action_test.js are failling
I have analysed more in detail one of them, "'should increment successful sms" case (probably the finding in this analysis apply to other cases). The problem is that the following asserting fails:
I have diged into the code and find the problem is in this part of the code in lib/myutils.js:
The test is failing because the statement
is not being executed. This is due the condition in the if clause Thus, why Some additional things to take into account:
|
Full log, in debug level:
|
Same test log in master (ok case):
|
After applying this filter to the output (to remove timestamps, etc.) The differences are: In master (ok):
In this PR brach (nok):
|
mongo 4.7.0 subdependencies:
mongo 3.6.12 subdependencies:
|
//db.serverConfig.on('reconnectFailed', function() { | ||
// logger.fatal('too many tries to reconnect to database, dying ...'); | ||
// process.exit(-2); | ||
//}); |
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.
You are always considered "connected" by the driver and then under the hood it auto reconnects for you
So all the reconnection logic in our code can be just removed. The driver will do it for us.