-
Notifications
You must be signed in to change notification settings - Fork 50
Fix getMongodStartedExpression for newer versions #40
base: master
Are you sure you want to change the base?
Conversation
Newer versions of mongod don't print "wating for connections" (or it's now a debug message) This line seems to indicate mongod is ready
This will break package for people that are setting versions
… On Jun 27, 2017, at 7:29 AM, Maciej Krüger ***@***.***> wrote:
Newer versions of mongod don't print "wating for connections" (or it's now a debug message)
This line seems to indicate mongod is ready
You can view, comment on, or merge this pull request online at:
#40
Commit Summary
Fix getMongodStartedExpression for newer versions
File Changes
M src/mongod-helper.ts (2)
Patch Links:
https://github.com/winfinit/mongodb-prebuilt/pull/40.patch
https://github.com/winfinit/mongodb-prebuilt/pull/40.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Oh, didn't think about that. |
I will check this out sometime this week also, I am wondering if dev release of mongo is broken and maybe we don't need to do much here... another thing that I would like to figure out is how to get latest production release instead of dev build.
… On Jun 27, 2017, at 9:08 AM, Maciej Krüger ***@***.***> wrote:
Oh, didn't think about that.
Maybe that should be dynamic based on the version. I just don't know at which version the regex broke.
(And I also have never written typescript)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@mkg20001 where did you get this information? When its correct we should check for both |
I found it. there are two different logs which indicates that the server is ready. @mkg20001 please add both messages and we are save. |
Done |
src/mongod-helper.ts
Outdated
stdoutHandler(message: string | Buffer): void { | ||
this.debug(`mongod stdout: ${message}`); | ||
let log: string = message.toString(); | ||
|
||
let mongodStartExpression: RegExp = this.getMongodStartedExpression(); | ||
let mongodStartExpression2: RegExp = this.getMongodStartedExpression2(); |
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.
Call it by the name Linux, Win32
BTW: to check that mongodb is running with this method is really bad we should check this with a db command in certain intervals. |
Hi @winfinit could you verify it and merge it ? |
src/mongod-helper.ts
Outdated
@@ -76,6 +77,10 @@ export class MongodHelper { | |||
return /waiting for connections on port/i; | |||
} | |||
|
|||
getMongodStartedExpression2(): RegExp { | |||
return /\[initandlisten\] setting featureCompatibilityVersion/i; | |||
} |
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.
Couldn't we use a single regexp with the two expressions, rather than two different functions ?
Something like /(waiting for connections on port|\[initandlisten\] setting featureCompatibilityVersion)/i
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.
Due to the performance it has no significant impact but it's more readable. The variable names could be renamed.
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.
I agree, parsing logs with regexp is pretty bad performance-wise anyway. And getMongodStartedExpression2
is not a very descriptive function name, I only suggested that for readability.
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.
Yes, this should be renamed.
@winfinit please review |
@winfinit it would be great if you have a look. |
@winfinit ??? |
@winfinit ?? |
?? |
Was this ever resolved? This is a blocker for me currently. |
Newer versions of mongod don't print "wating for connections" (or it's now a debug message)
This line seems to indicate mongod is ready
Fixes #45