-
-
Notifications
You must be signed in to change notification settings - Fork 243
fix: made studio start on different port if one is already in use #1815
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
base: master
Are you sure you want to change the base?
fix: made studio start on different port if one is already in use #1815
Conversation
Signed-off-by: Tushar Anand <tusharannand@gmail.com>
🦋 Changeset detectedLatest commit: 1416652 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Changeset has been generated for this PR as part of auto-changeset workflow.Please review the changeset before merging the PR.
If you are a maintainer or the author of the PR, you can change the changeset by clicking here Tip If you don't want auto-changeset to run on this PR, you can add the label |
@asyncapi/bounty_team |
Hey @AayushSaini101 @Shurtu-gal if possible can this be reviewed and merged as #1824 is dependent on this. Thanks |
Hey @AayushSaini101 @Shurtu-gal any update on this ? |
I guess we should not go ahead with this iterative checking of ports. Can use stuff like: https://expressjs.com/en/api.html#app.listen Basically mentioning port as 0 gets the OS to allocate a port. |
Is this specific to express.js? I believe we are not using express. And also it might cause inconsistency as OS will always assign a random port with this method not only for case if port is already in use. |
We are using nodejs http which has the same functionality. |
Okay but assigning a random port every time , would it be a good practice and experience ? Also it will make testing harder i believe. |
One concern for me with the random port approach is testing these commands through puppeteer. As we need to navigate to the url for testing and since we include port in the url query parameters it being random would make it extremely difficult to navigate that site and test the instance as url would be random every time. Inferring it from logs is extremely difficult as it would require a lot of parsing which make tests un-reliable. Passing the port through flag is also not possible as we can only pass strings in parameter in tests but port require a number which cannot be passed. |
Hey @Shurtu-gal with respect to above discussion how should i proceed with this ? |
I suppose we can wait for @AayushSaini101 or @Souvikns input also. |
/u |
|
I guess we can go for iterating port allocation to the server, explicitly allocating the port is not a proper way, wdyt @Souvikns |
Setting up server and checking each port is not the way to go according to me.
I couldn't understand this. |
|
Description
The PR adds the functionality to automatically start a new instance of studio on a different port if the current port intended to be used is already in use.
An info is displayed that the specified port was already in use hence a different port is being used to the user.
Related issue(s)
Resolves #1797