-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Incorrect SDS grpc server logs #51433
Comments
move just before serve, and change a little |
And more correctly we can check |
Something akin to #51452 ?
Do you mean to check the Serve() error and stop the retry early if ErrServerStopped? |
Is this the right place to submit this?
Bug Description
I noticed that in case of a termination of pilot-agent, just before the gw/sidecar container stops, we get a
"SDS server for workload certificates started, listening on ... " message.
This does not make much sense since the server was definetly running before the termination of the agent took place.
This logs is being printed at the wrong time because the code does not take into account that s.grpcWorkloadServer.Serve is a blocking operation.
As a consequence the init goroutine will be stuck waiting for the server to either throw an error or stop serving.
This is no on par with what I presume was the intended behavior of the init goroutine: 'start the Server up to 5 times and print a success or failure log entry.'
https://github.com/istio/istio/blob/master/security/pkg/nodeagent/sds/server.go#L83-L115
When a termination of pilot-agent happens then Serve() will be stopped (with return value nil) and the code will finally print "SDS server for workload certicates started".
We could remove this log line, as it can be misleading. Ideally, we should preserve it and print it at the appropriate time by having the goroutine to no longer block on Serve. While we could run Serve() in another goroutine, I don´t see an grpc.Server function/flag available to check its status, which would help us determine when to print the message. WTDY?
Version
Additional Information
No response
The text was updated successfully, but these errors were encountered: