-
-
Notifications
You must be signed in to change notification settings - Fork 213
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 nrepl port race condition #972
Conversation
Ah, great that you found where this happens! It's consistent with the behaviour that this just happens now and then. However, we can't delete that code. It is used for the Calva Connect command. What you'll need to do is to only execute it conditionally. So if we already have a port, this should not be done, otherwise it should. |
Tested the VSIX built from the PR locally, but not the one off circleci, nor will I do so. |
That's perfectly OK. The point is to make sure the release build works in the sense that the tree shaking and munging hasn't broken things. It is tested just as well with your locally built VSIX: |
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.
Let's merge.
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.
This needs to be addressed before merge.
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. We're getting there. 😄
Generally (and we should add this to the contribution guidelines) we want fixes like this to be quite surgical. You've found the place for the race condition, you've fixed it. If you see other changes that should be made, better send them in a separate PR.
Race is: the get-port-from-file code overwrites the port-from-regex with nothing when the nrepl-port file is not yet present at the time is read. Fix: don't get-port-from-file when port already present. Improved get-port-from-file such that it waits for file to be present with a timeout. Fixes #901
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. Totally appreciate that you helped fix this and followed through.
What has Changed?
Fixes #901
My Calva PR Checklist
I have:
dev
branch. (Or have specific reasons to target some other branch.)published
. (Sorry for the nagging.)[Unreleased]
entry inCHANGELOG.md
, linking the issue(s) that the PR is addressing.The Calva Team PR Checklist:
Before merging we (at least one of us) have:
dev
branch (unless reasons).Ping @PEZ, @kstehn, @cfehse, @bpringe