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

integration: Fixes deadlock in 'go test -tags cluster_proxy -v ./integration/... ./clientv3/...' #12319

Merged
merged 1 commit into from
Sep 25, 2020

Conversation

ptabor
Copy link
Contributor

@ptabor ptabor commented Sep 20, 2020

The grpc-proxy test logic was assuming that the context associated to client is closed,
while in practice all tests called client.Close() without explicit context close.

The current testing strategy is complicated 2 fold:

  • grpc proxy works like man-in-the middle of each Connection issues
    from integration tests and its lifetime is bound to the connection.
  • both connections (client -> proxy, and proxy -> etcd-server) are
    represented by the same ClientV3 object instance (with substituted
    implementations of KV or watcher).

The fix splits context representing proxy from context representing proxy -> etcd-server connection,
thus allowing cancelation of the proxy context.

etcdmain/grpc_proxy.go Outdated Show resolved Hide resolved
@xiang90
Copy link
Contributor

xiang90 commented Sep 25, 2020

lgtm after fixing the nit.

@ptabor ptabor force-pushed the 20200920-proxy-test-ctx branch 2 times, most recently from cdb4705 to 90c1559 Compare September 25, 2020 18:22
…ntv3/...' passes now.

The grpc-proxy test logic was assuming that the context associated to client is closed,
while in practice all tests called client.Close() without explicit context close.

The current testing strategy is complicated 2 fold:
  - grpc proxy works like man-in-the middle of each Connection issues
from integration tests and its lifetime is bound to the connection.
  - both connections (client -> proxy, and proxy -> etcd-server) are
represented by the same ClientV3 object instance (with substituted
implementations of KV or watcher).

The fix splits context representing proxy from context representing proxy -> etcd-server connection,
thus allowing cancelation of the proxy context.
@ptabor ptabor force-pushed the 20200920-proxy-test-ctx branch from 90c1559 to 4676af6 Compare September 25, 2020 18:22
@ptabor
Copy link
Contributor Author

ptabor commented Sep 25, 2020

Thank you for review !

@xiang90 xiang90 merged commit 73e5714 into etcd-io:master Sep 25, 2020
ahrtr added a commit to ahrtr/etcd that referenced this pull request Jun 28, 2022
…lientv3/...'

Cherry pick etcd-io#12319 to 3.4.

Signed-off-by: Benjamin Wang <[email protected]>
tjungblu pushed a commit to tjungblu/etcd that referenced this pull request Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants