-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Proposal: strict port handling and enable flags for Skaffold API (deprecate --enable-rpc) #6425
Comments
My upvote for:
AFAIK the API server should only be relevant to |
I think the IDEs rely on these flags and use them. You will have to co-ordinate this change with them. |
Ack. I'll find out who are the 1st-party callers of these servers and coordinate changes. If they are not specifying --http-port/--rpc-port already, this is a breaking change as it won't start the server by default. Based on recommendations I am updating the proposal to:
|
Added an I think this change is safe to do with the assumption that Cloud Code is the only notable user of the APIs. |
@gsquared94 @briandealwis If we were to start servers via specifying --rpc-port or --rpc-http-port (or both), should we deprecate the It seems like now that the enablement would be implied by setting those other flags, and we no longer would be doing per-command enabling of this flag (for Guidance is appreciated. |
I think specifying |
@gsquared94 I am thinking this behavior can be acceptable. But we can add strict failures to specifying --enable-rpc without any port flags. What's worse is specifying ports without --enable-rpc (flag with intention should not be silently ignored). I actually wanted to do this in the PR but I could not figure out where this validation would go, yet. |
That's the consensus we now reached in our offline meeting! |
Problem
Right now our GRPC/HTTP servers try to choose a port that's different than the provided port number if that's busy. This is problematic for a number of reasons:
usedPorts
, and then make a decision based on that → this is not atomic (something might've bind()ed to that port by then, which makes the tests flaky)starting gRPC server on port %d
) → either case bad UX fo the caller?--rpc-port
should either succeed or fail (TestRunPortForward flake) #6375 [Flake] TestEventsRPC is flaky #6417Context: I believe this port choosing logic was added in response to #4253.
Proposed Solution
Do not start API server by default unless the caller specifies
--rpc-port
or both--rpc-http-port
. (Current behavior: by defaultdev
/run
commands start grpc/http ports 50051/50052, and find adjacent available ports if they are not available).Usage of either
--rpc-port
or--rpc-http-port
now imply--enable-rpc=true
.--enable-rpc
flag will be deprecated. All notable customers such as Cloud Code for VSC+IntelliJ are impacted from this.If specified port numbers are busy, Skaffold now fails instead of trying to find an adjacent available port. (Let caller find a free port, they can call random() if they like). We might
Impact on Existing Users
Taken only Cloud Code into consideration:
This is a breaking change for those (1) relying on API servers starting by default and (2) those relying on skaffold's "find an adjacent open port if given port is unavailable" (and parse the actual port from logs). Thankfully Cloud Code is unimpacted:
--rpc-http-port
and they use a library to find an available port (which uses :0 mechanism, more prone to collisions). They also use--enable-rpc=true
which will be deprecated with this proposal.--rpc-port
and they also scan local ports to find an open port (chooses rand port from an open range, less prone to collisions.) They also use--enable-rpc=true
which will be deprecated with this proposal.In both cases, the port finding is susceptible to a race condition where the caller thinks the found port number is available, and they pass it to Skaffold, but some other process might've started using it. I don't think we can fix this problem (short of using Unix domain sockets and Windows named pipes).
/cc @nkubala
/area cleanup
/kind design discussion
The text was updated successfully, but these errors were encountered: