Skip to content

Race condition at usage component startup #11743

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

Closed
Tracked by #9036
andrew-farries opened this issue Jul 29, 2022 · 0 comments · Fixed by #11747
Closed
Tracked by #9036

Race condition at usage component startup #11743

andrew-farries opened this issue Jul 29, 2022 · 0 comments · Fixed by #11747
Labels
team: webapp Issue belongs to the WebApp team type: bug Something isn't working

Comments

@andrew-farries
Copy link
Contributor

andrew-farries commented Jul 29, 2022

There is a race condition at usage component startup between the billing gRPC service being available and the billing client trying to connect to it:

{"config":{"controllerSchedule":"10s","creditsPerMinuteByWorkspaceClass":{"default":0.1666666667,"gitpodio-internal-xl":0.3333333333},"server":{"services":{"grpc":{"address":":9001"}}}},"level":"info","message":"Starting usage component.","serviceContext":{"service":"usage","version":""},"severity":"INFO","time":"2022-07-29T08:43:30Z"}
{"level":"info","message":"Starting usage controller.","serviceContext":{"service":"usage","version":""},"severity":"INFO","time":"2022-07-29T08:43:30Z"}
{"component":"grpc","level":"warning","message":"2022/07/29 08:43:30 WARNING: [core] [Channel #2 SubChannel #3] grpc: addrConn.createTransport failed to connect to {","serviceContext":{"service":"usage","version":""},"severity":"WARNING","time":"2022-07-29T08:43:30Z"}
{"component":"grpc","level":"warning","message":"  \"Addr\": \":9001\",","serviceContext":{"service":"usage","version":""},"severity":"WARNING","time":"2022-07-29T08:43:30Z"}
{"component":"grpc","level":"warning","message":"  \"ServerName\": \"localhost:9001\",","serviceContext":{"service":"usage","version":""},"severity":"WARNING","time":"2022-07-29T08:43:30Z"}
{"component":"grpc","level":"warning","message":"  \"Attributes\": null,","serviceContext":{"service":"usage","version":""},"severity":"WARNING","time":"2022-07-29T08:43:30Z"}
{"component":"grpc","level":"warning","message":"  \"BalancerAttributes\": null,","serviceContext":{"service":"usage","version":""},"severity":"WARNING","time":"2022-07-29T08:43:30Z"}
{"component":"grpc","level":"warning","message":"  \"Type\": 0,","serviceContext":{"service":"usage","version":""},"severity":"WARNING","time":"2022-07-29T08:43:30Z"}
{"component":"grpc","level":"warning","message":"  \"Metadata\": null","serviceContext":{"service":"usage","version":""},"severity":"WARNING","time":"2022-07-29T08:43:30Z"}
{"component":"grpc","level":"warning","message":"}. Err: connection error: desc = \"transport: Error while dialing dial tcp :9001: connect: connection refused\"","serviceContext":{"service":"usage","version":""},"severity":"WARNING","time":"2022-07-29T08:43:30Z"}

This is easy to trigger when running the component locally. In a preview environment it also happens regularly when the component starts.

This is a warning rather than an error because gRPC dialling includes logic for backoff and automatic retry.

See this comment on #1165.

@andrew-farries andrew-farries added type: bug Something isn't working team: webapp Issue belongs to the WebApp team labels Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: webapp Issue belongs to the WebApp team type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant