Skip to content
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

GRPCRoute conformance tests failing with client connection is closing #3122

Closed
ciarams87 opened this issue May 31, 2024 · 3 comments · Fixed by #3130
Closed

GRPCRoute conformance tests failing with client connection is closing #3122

ciarams87 opened this issue May 31, 2024 · 3 comments · Fixed by #3130
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@ciarams87
Copy link
Contributor

What happened:

Our GRPCRoute conformance tests are failing running against the main branch with

RPC finished with error: rpc error: code = Canceled desc = grpc: the client connection is closing

These are running and working successfully against v1.1.0.

What you expected to happen:

The requests are not cancelled and the tests pass

How to reproduce it (as minimally and precisely as possible):

Run the conformance test suite against any implementation using the default GRPC client

Anything else we need to know?:

As far as I can tell, this is happening as a result of #3095.

As part of the changes introduced in this PR, we are sharing one client between all requests instead of instantiating a new client for every GRPC request. However, each request is still calling defer c.Close() which means the client connection will be closed when this function returns even if another request is using the connection. Additionally, each call to sendRPC sets the connection specific to the call being made, and will reset the current connection if present. Because the tests run in parallel, this is causing conflicts and race conditions.

Example conformance test run with the failures: https://github.com/nginxinc/nginx-gateway-fabric/actions/runs/9312728851/job/25634135132

@ciarams87
Copy link
Contributor Author

I believe a straight forward fix will be to return the default client instantiation to every request instead of having a top level shared client - like here.

Happy to work on this and open a PR if it makes sense!

@robscott
Copy link
Member

robscott commented Jun 3, 2024

Thanks for catching this @ciarams87! The fix looks reasonable to me, but would also like to have @snehachhabria and @gnossen review any follow up PR.

@ciarams87
Copy link
Contributor Author

/assign @ciarams87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
2 participants