Skip to content
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 error message passing in Server::Start #1225

Merged
merged 1 commit into from
Jan 15, 2023

Conversation

PragmaTwice
Copy link
Member

No description provided.

Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

May you add a description on what is fixed and the different before and after?

@PragmaTwice
Copy link
Member Author

PragmaTwice commented Jan 15, 2023

May you add a description on what is fixed and the different before and after?

https://github.com/apache/incubator-kvrocks/blob/f1f7c10a30dc3387f6ffd77fe3c6efe2f393ed38/src/server/server.cc#L135

For example, before the PR, the error message in this line can never be dumped into log. So users can hardly know why the server fail to start.

@tisonkun
Copy link
Member

Merging...

@tisonkun tisonkun merged commit c01a5c1 into apache:unstable Jan 15, 2023
@@ -319,8 +319,7 @@ int main(int argc, char *argv[]) {
uint32_t ports[] = {config.port, config.tls_port, 0};
for (uint32_t *port = ports; *port; ++port) {
if (Util::IsPortInUse(*port)) {
LOG(ERROR) << "Could not create server TCP since the specified port[" << *port << "] is already in use"
<< std::endl;
LOG(ERROR) << "Could not create server TCP since the specified port[" << *port << "] is already in use";
Copy link
Member

Choose a reason for hiding this comment

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

Does LOG already append endl?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure.

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.

3 participants