-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add port in use check to prevent browser redirecting incorrectly for kedro viz #2176
Conversation
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
hey @SajidAlamQB , can we not increment the port number here, directly, if 4141 is occupied, go to 4142, if that is occupied which is it always, go to 4143? |
maybe we put a specific range from 4141, to 4145, and if all the ports in this range are busy, then they tell us which one through --port. |
This is a good middle approach we definitely can do. |
Signed-off-by: Sajid Alam <[email protected]>
@SajidAlamQB , thanks for this , will review this once tests are passing, can we also add unit-testing to this, if we can mock ports being occupied ? |
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
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.
Works well and LGTM. Thank you @SajidAlamQB 💯
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.
Awesome, thanks @SajidAlamQB
Signed-off-by: Sajid Alam <[email protected]>
Signed-off-by: Sajid Alam <[email protected]>
Description
Related to: #2052
If there is an existing Kedro Viz server running, kedro viz run will redirect the browser to that one when a second instance of kedro viz is launched using the same port and the error message from uvicorn is missed.
Development notes
Check that the port is in use before running the server and increment it until a max 5 times to find an alternative free port, if none are found send error message to users no free ports available and suggest them to use
--port
.QA notes
Checklist
RELEASE.md
file