Skip to content

Improve error reporting in start-servers.php and fix 3.0 servers #856

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

Merged
merged 4 commits into from
Jun 21, 2018

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Jun 20, 2018

Improves error reporting for failures in start-servers.php.

Also fixes an issue that prevented 3.0 servers from starting successfully after bind_ip was added in 0f2e387 (#850). See SERVER-35705 for more info.

jmikola added 3 commits June 20, 2018 11:24
This fixes an issue introduced in 0f2e387. Trailing colons causes mongod to incorrectly assume the legacy config file produced by MO is in YAML format. We can work around this by swapping the order of the IPv6 and IPv4 addresses.
@jmikola jmikola requested a review from derickr June 20, 2018 18:12
@jmikola jmikola changed the title Start servers Improve error reporting in start-servers.php and fix 3.0 servers Jun 20, 2018
}

return $result;
}

function json_decode_or_fail(/* json_decode() args */)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No variadics for here and the call to json_decode below? http://php.net/manual/en/functions.arguments.php#functions.variable-arg-list

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not until we drop PHP 5.5 compatibility.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"start-servers.php" doesn't have to be PHP 5.5 compatible though...

@@ -47,30 +47,39 @@ function make_ctx($preset, $method = "POST") {
return $ctx;
}

function failed($result) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I quite liked the failed, with the print, the "last operation time" and the exit. I would rather see this repurposed than deleted.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored in eafc29a.

Copy link
Contributor

@derickr derickr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm (but with a comment)

}

return $result;
}

function json_decode_or_fail(/* json_decode() args */)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"start-servers.php" doesn't have to be PHP 5.5 compatible though...

@jmikola
Copy link
Member Author

jmikola commented Jun 21, 2018

Added variadic args and splat.

jmikola added a commit to jmikola/mongo-php-driver that referenced this pull request Jun 21, 2018
@jmikola jmikola merged commit d4c2e33 into mongodb:master Jun 21, 2018
@jmikola jmikola deleted the start-servers branch June 21, 2018 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants