-
Notifications
You must be signed in to change notification settings - Fork 383
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
Find unused port for codechecker server #3663
Conversation
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.
Thanks for the improvement, it's a very nice job!
I think, however, that finding a free port shouldn't be an automatic thing even in case of using the default port. If the default port (8001) is not free then it still should be an error. We should only get a free port from os
only if the user explicitly provides port 0.
so the user can just use |
Oh, sorry, the specification in the original ticket is not accurate. You implemented it according to the specification, but I think we shouldn't consider port 8001 as a special case. We should choose one of these alternatives:
In my previous comment I suggested the first option, because many other CodeChecker commands are assuming this port number. For example |
without my commit these are the scenarios: |
could change the error message to say "Server can't be started ... use |
Yes, that message would be a good solution. I've checked the original version of this ticket in an internal ticket system and this task belonged to an old CodeChecker version. Port 0 really works as expected by now, sorry, I haven't checked it before creating this ticket. My bad :( |
no problem. I canceled the changes, and just changed the message |
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.
Thank you!
Hi, this closes #3657.
if default port is not available, and the user didn't ask for a specific one - let the os find a port.