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

descriptive log for port unavailable and port-retries=0 #5136

Merged
merged 2 commits into from Jan 7, 2020

Conversation

pallavibharadwaj
Copy link
Contributor

@pallavibharadwaj pallavibharadwaj commented Jan 4, 2020

when --port-retries=0 and the launch fails on the port, the error logERROR: the notebook server could not be started because no available port could be found. is not very appropriate. Fixes: #1914

Copy link
Member

@kevin-bates kevin-bates left a comment

Choose a reason for hiding this comment

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

This change looks good - thank you.

While we're on this topic and this area of the code, I think a similar change should be made to the info message within the for loop. That is, don't issue the "trying another port" clause when retries are not desired.

@kevin-bates
Copy link
Member

Also please edit your initial comment above to include Fixes: #1914 as the last line in the comment. This instructs git to close that Issue upon the merge of this PR. Thanks.

@pallavibharadwaj
Copy link
Contributor Author

Edited the comment, thank you.

Is removing the trying another port part of the log a good idea, since that would be consistent with Permission to listen on port 403 denied? Or would you suggest having this clause in both the cases?

@kevin-bates
Copy link
Member

I'm only suggesting the clause's removal when self.port_retries == 0. When non-zero we should indicate other ports will be attempted, but not when retries are disabled. I believe the permission message is fine as-is - although I suppose one could argue that it too should include the 'trying another port` clause (only when retries are enabled). That said, you typically want to provide only the necessary information in security-related messaging, so perhaps leaving that one alone is probably best given it didn't include the clause in the first place.

@pallavibharadwaj
Copy link
Contributor Author

@kevin-bates - I have added the changes you suggested, in the PR. I made a new commit instead of rebasing, in order to highlight my new changes. I will rebase the commits if needed after you approve it. Thank you.

notebook/notebookapp.py Outdated Show resolved Hide resolved
Copy link
Member

@kevin-bates kevin-bates left a comment

Choose a reason for hiding this comment

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

LGTM - thank you for you first contribution! 🎉

Copy link
Member

@Zsailer Zsailer left a comment

Choose a reason for hiding this comment

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

LGTM!

@Zsailer Zsailer merged commit f354740 into jupyter:master Jan 7, 2020
@pallavibharadwaj pallavibharadwaj deleted the issue_1914 branch January 7, 2020 20:07
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tries random ports, even if --port is given
3 participants