You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

183 lines
4.7 KiB

8 years ago
build(deps): Bump google.golang.org/grpc from 1.42.0 to 1.43.0 (#7455) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.42.0 to 1.43.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/grpc/grpc-go/releases">google.golang.org/grpc's releases</a>.</em></p> <blockquote> <h2>Release 1.43.0</h2> <h1>API Changes</h1> <ul> <li>grpc: stabilize <code>WithConnectParams</code> <code>DialOption</code> (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4915">#4915</a>) <ul> <li>Special Thanks: <a href="https://github.com/hypnoglow"><code>@​hypnoglow</code></a></li> </ul> </li> </ul> <h1>Behavior Changes</h1> <ul> <li>status: support wrapped errors in <code>FromContextError</code> (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4977">#4977</a>) <ul> <li>Special Thanks: <a href="https://github.com/bestbeforetoday"><code>@​bestbeforetoday</code></a></li> </ul> </li> <li>config: remove the environment variable to disable retry support (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4922">#4922</a>)</li> </ul> <h1>New Features</h1> <ul> <li>balancer: new field <code>Authority</code> in <code>BuildOptions</code> for server name to use in the authentication handshake with a remote load balancer (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4969">#4969</a>)</li> </ul> <h1>Bug Fixes</h1> <ul> <li>xds/resolver: fix possible <code>ClientConn</code> leak upon resolver initialization failure (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4900">#4900</a>)</li> <li>client: fix <code>nil</code> panic in rare race conditions with the pick first LB policy (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4971">#4971</a>)</li> <li>xds: improve RPC error messages when xDS connection errors occur (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5032">#5032</a>, <a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5054">#5054</a>)</li> <li>transport: do not create stream object in the face of illegal stream IDs (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4873">#4873</a>) <ul> <li>Special Thanks: <a href="https://github.com/uds5501"><code>@​uds5501</code></a></li> </ul> </li> </ul> <h1>Documentation</h1> <ul> <li>client: clarify errors to indicate whether compressed or uncompressed messages exceeded size limits (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4918">#4918</a>) <ul> <li>Special Thanks: <a href="https://github.com/uds5501"><code>@​uds5501</code></a></li> </ul> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/grpc/grpc-go/commit/14c11384b76b67f7b1b32a5d18f865762634c0ae"><code>14c1138</code></a> Change version to 1.43.0 (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5039">#5039</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/ae29ac3e1e62a7b47fb672dec21de2dd83e4f027"><code>ae29ac3</code></a> xds/client: send NewStream errors to the watchers (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5032">#5032</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/296afc2e579c14228edadb3debcb040204a0870f"><code>296afc2</code></a> transport: better error message when per-RPC creds fail (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5033">#5033</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/e15d978c827661f8e7cfe807cb9fd8fd8f15a262"><code>e15d978</code></a> xds/client: send connection errors to all watchers (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5054">#5054</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/46e883a9ab006a3000afe0a510aea62b75495b8f"><code>46e883a</code></a> Backport &quot;xds/c2p: replace C2P resolver env var with experimental scheme suff...</li> <li><a href="https://github.com/grpc/grpc-go/commit/3786ae1778f5bfcc49da81cbd925b7175ec81839"><code>3786ae1</code></a> xds/resolver: Add support for cluster specifier plugins (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4987">#4987</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/512e89474bfbd567806e026e0afdec468b1ee1ea"><code>512e894</code></a> rls: support extra_keys and constant_keys (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4995">#4995</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/f3bbd12084380987ae0c9fcccdd7c4d405294a68"><code>f3bbd12</code></a> xds/bootstrap_config: add a string function to server config (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5031">#5031</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/46935b96506deef74e73192e70cc44e3795b1452"><code>46935b9</code></a> fix possible nil before casting (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5017">#5017</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/c2bccd0b1594416da57a74d15f09f8eb0a3d727b"><code>c2bccd0</code></a> xds/kokoro: install go 1.17, and retry go build (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5015">#5015</a>)</li> <li>Additional commits viewable in <a href="https://github.com/grpc/grpc-go/compare/v1.42.0...v1.43.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=google.golang.org/grpc&package-manager=go_modules&previous-version=1.42.0&new-version=1.43.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
3 years ago
8 years ago
build(deps): Bump google.golang.org/grpc from 1.41.0 to 1.42.0 (#7200) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.41.0 to 1.42.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/grpc/grpc-go/releases">google.golang.org/grpc's releases</a>.</em></p> <blockquote> <h2>Release 1.42.0</h2> <h1>Behavior Changes</h1> <ul> <li>grpc: Dial(&quot;unix://relative-path&quot;) no longer works (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4817">#4817</a>) <ul> <li>use &quot;unix://absolute-path&quot; or &quot;unix:relative-path&quot; instead in accordance with <a href="https://github.com/grpc/grpc/blob/master/doc/naming.md#name-syntax">our documentation</a></li> </ul> </li> <li>xds/csds: use new field <code>GenericXdsConfig</code> instead of <code>PerXdsConfig</code> (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4898">#4898</a>)</li> </ul> <h1>New Features</h1> <ul> <li>grpc: support <code>grpc.WithAuthority</code> when secure credentials are used (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4817">#4817</a>)</li> <li>creds/google: add NewDefaultCredentialsWithOptions() to support custom per-RPC creds (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4830">#4830</a>)</li> <li>authz: create file watcher interceptor for gRPC SDK API (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4760">#4760</a>)</li> <li>attributes: add <code>Equal</code> method (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4855">#4855</a>)</li> <li>resolver: add <code>AddressMap</code> and <code>State.BalancerAttributes</code> (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4855">#4855</a>)</li> <li>resolver: Add <code>URL</code> field to <code>Target</code> to store parsed dial target (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4817">#4817</a>)</li> <li>grpclb: add a <code>target_name</code> field to lb config to specify target when used as a child policy (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4847">#4847</a>)</li> <li>grpclog: support formatting log output as JSON (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4854">#4854</a>)</li> </ul> <h1>Bug Fixes</h1> <ul> <li>server: add missing conn.Close if the connection dies before reading the HTTP/2 preface (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4837">#4837</a>)</li> <li>grpclb: recover if addresses are received after an empty server list was received previously (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4879">#4879</a>)</li> <li>authz: support empty principals and fix rbac authenticated matcher (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4883">#4883</a>)</li> <li>xds/rds: NACK the RDS response if it contains unknown cluster specifier (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4788">#4788</a>)</li> <li>xds/priority: do not switch to low priority when high priority is in Idle (e.g. ringhash) (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4889">#4889</a>)</li> </ul> <h1>Documentation</h1> <ul> <li>grpc: stabilize WithDefaultServiceConfig and improve godoc (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4888">#4888</a>)</li> <li>status: clarify FromError docstring (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4880">#4880</a>)</li> <li>examples: add example illustrating the use of unix abstract sockets (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4848">#4848</a>)</li> <li>examples: update load balancing example to use loadBalancingConfig (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4887">#4887</a>)</li> <li>doc: promote WithDisableRetry to stable; clarify retry is enabled by default (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4901">#4901</a>)</li> </ul> <h1>API Changes</h1> <ul> <li>credentials: Mark <code>TransportCredentials.OverrideServerName</code> method as deprecated (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4817">#4817</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/grpc/grpc-go/commit/aff571cc86e6e7e740130dbbb32a9741558db805"><code>aff571c</code></a> Change version to 1.42.0 (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4910">#4910</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/2d7bdf2d2327ce888df559ca90db6bac53ef8b99"><code>2d7bdf2</code></a> xds: Set RBAC on by default (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4909">#4909</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/d47437c91e798b5370e019660cd74c9c0c8e32fb"><code>d47437c</code></a> xds: Fix invert functionality for header matcher (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4902">#4902</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/9fa26982649594f2b84a442644d3c8995d4dac1b"><code>9fa2698</code></a> xds/csds: populate new GenericXdsConfig field (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4898">#4898</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/6e8625df635bd7afe589d38a1559ebacf4273b07"><code>6e8625d</code></a> doc: promote WithDisableRetry to stable; clarify retry is enabled by default ...</li> <li><a href="https://github.com/grpc/grpc-go/commit/f1d87c14c2165a7ddbc26f6319e777c88c1b3c85"><code>f1d87c1</code></a> client: properly disable retry if GRPC_GO_RETRY=off (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4899">#4899</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/03753f593ccb9034846f7a17db5165a4827b35a2"><code>03753f5</code></a> creds/google: fix CFE cluster name check (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4893">#4893</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/4f21cde702d9f9b1c874791e1c3751b1f7d192ce"><code>4f21cde</code></a> authz: support empty principals and fix rbac authenticated matcher (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4883">#4883</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/f00baa6c3c8455ef1db2ac64f7b89a63ec7d2776"><code>f00baa6</code></a> resolver: replace AddressMap.Range with Keys (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4891">#4891</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/2a312458e6bd0d3fd9ffccee9b6906b6e753bb8f"><code>2a31245</code></a> client: don't force passthrough as default resolver (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4890">#4890</a>)</li> <li>Additional commits viewable in <a href="https://github.com/grpc/grpc-go/compare/v1.41.0...v1.42.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=google.golang.org/grpc&package-manager=go_modules&previous-version=1.41.0&new-version=1.42.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
3 years ago
build(deps): Bump google.golang.org/grpc from 1.42.0 to 1.43.0 (#7455) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.42.0 to 1.43.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/grpc/grpc-go/releases">google.golang.org/grpc's releases</a>.</em></p> <blockquote> <h2>Release 1.43.0</h2> <h1>API Changes</h1> <ul> <li>grpc: stabilize <code>WithConnectParams</code> <code>DialOption</code> (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4915">#4915</a>) <ul> <li>Special Thanks: <a href="https://github.com/hypnoglow"><code>@​hypnoglow</code></a></li> </ul> </li> </ul> <h1>Behavior Changes</h1> <ul> <li>status: support wrapped errors in <code>FromContextError</code> (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4977">#4977</a>) <ul> <li>Special Thanks: <a href="https://github.com/bestbeforetoday"><code>@​bestbeforetoday</code></a></li> </ul> </li> <li>config: remove the environment variable to disable retry support (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4922">#4922</a>)</li> </ul> <h1>New Features</h1> <ul> <li>balancer: new field <code>Authority</code> in <code>BuildOptions</code> for server name to use in the authentication handshake with a remote load balancer (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4969">#4969</a>)</li> </ul> <h1>Bug Fixes</h1> <ul> <li>xds/resolver: fix possible <code>ClientConn</code> leak upon resolver initialization failure (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4900">#4900</a>)</li> <li>client: fix <code>nil</code> panic in rare race conditions with the pick first LB policy (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4971">#4971</a>)</li> <li>xds: improve RPC error messages when xDS connection errors occur (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5032">#5032</a>, <a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5054">#5054</a>)</li> <li>transport: do not create stream object in the face of illegal stream IDs (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4873">#4873</a>) <ul> <li>Special Thanks: <a href="https://github.com/uds5501"><code>@​uds5501</code></a></li> </ul> </li> </ul> <h1>Documentation</h1> <ul> <li>client: clarify errors to indicate whether compressed or uncompressed messages exceeded size limits (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4918">#4918</a>) <ul> <li>Special Thanks: <a href="https://github.com/uds5501"><code>@​uds5501</code></a></li> </ul> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/grpc/grpc-go/commit/14c11384b76b67f7b1b32a5d18f865762634c0ae"><code>14c1138</code></a> Change version to 1.43.0 (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5039">#5039</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/ae29ac3e1e62a7b47fb672dec21de2dd83e4f027"><code>ae29ac3</code></a> xds/client: send NewStream errors to the watchers (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5032">#5032</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/296afc2e579c14228edadb3debcb040204a0870f"><code>296afc2</code></a> transport: better error message when per-RPC creds fail (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5033">#5033</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/e15d978c827661f8e7cfe807cb9fd8fd8f15a262"><code>e15d978</code></a> xds/client: send connection errors to all watchers (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5054">#5054</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/46e883a9ab006a3000afe0a510aea62b75495b8f"><code>46e883a</code></a> Backport &quot;xds/c2p: replace C2P resolver env var with experimental scheme suff...</li> <li><a href="https://github.com/grpc/grpc-go/commit/3786ae1778f5bfcc49da81cbd925b7175ec81839"><code>3786ae1</code></a> xds/resolver: Add support for cluster specifier plugins (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4987">#4987</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/512e89474bfbd567806e026e0afdec468b1ee1ea"><code>512e894</code></a> rls: support extra_keys and constant_keys (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/4995">#4995</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/f3bbd12084380987ae0c9fcccdd7c4d405294a68"><code>f3bbd12</code></a> xds/bootstrap_config: add a string function to server config (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5031">#5031</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/46935b96506deef74e73192e70cc44e3795b1452"><code>46935b9</code></a> fix possible nil before casting (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5017">#5017</a>)</li> <li><a href="https://github.com/grpc/grpc-go/commit/c2bccd0b1594416da57a74d15f09f8eb0a3d727b"><code>c2bccd0</code></a> xds/kokoro: install go 1.17, and retry go build (<a href="https://github-redirect.dependabot.com/grpc/grpc-go/issues/5015">#5015</a>)</li> <li>Additional commits viewable in <a href="https://github.com/grpc/grpc-go/compare/v1.42.0...v1.43.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=google.golang.org/grpc&package-manager=go_modules&previous-version=1.42.0&new-version=1.43.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
3 years ago
8 years ago
  1. package example
  2. import (
  3. "context"
  4. "fmt"
  5. "math/rand"
  6. "net"
  7. "os"
  8. "reflect"
  9. "testing"
  10. "time"
  11. "github.com/stretchr/testify/require"
  12. "google.golang.org/grpc"
  13. "google.golang.org/grpc/credentials/insecure"
  14. "github.com/tendermint/tendermint/libs/log"
  15. tmnet "github.com/tendermint/tendermint/libs/net"
  16. abciclient "github.com/tendermint/tendermint/abci/client"
  17. "github.com/tendermint/tendermint/abci/example/code"
  18. "github.com/tendermint/tendermint/abci/example/kvstore"
  19. abciserver "github.com/tendermint/tendermint/abci/server"
  20. "github.com/tendermint/tendermint/abci/types"
  21. )
  22. func init() {
  23. rand.Seed(time.Now().UnixNano())
  24. }
  25. func TestKVStore(t *testing.T) {
  26. ctx, cancel := context.WithCancel(context.Background())
  27. defer cancel()
  28. logger := log.NewTestingLogger(t)
  29. logger.Info("### Testing KVStore")
  30. testStream(ctx, t, logger, kvstore.NewApplication())
  31. }
  32. func TestBaseApp(t *testing.T) {
  33. ctx, cancel := context.WithCancel(context.Background())
  34. defer cancel()
  35. logger := log.NewTestingLogger(t)
  36. logger.Info("### Testing BaseApp")
  37. testStream(ctx, t, logger, types.NewBaseApplication())
  38. }
  39. func TestGRPC(t *testing.T) {
  40. ctx, cancel := context.WithCancel(context.Background())
  41. defer cancel()
  42. logger := log.NewTestingLogger(t)
  43. logger.Info("### Testing GRPC")
  44. testGRPCSync(ctx, t, logger, types.NewGRPCApplication(types.NewBaseApplication()))
  45. }
  46. func testStream(ctx context.Context, t *testing.T, logger log.Logger, app types.Application) {
  47. t.Helper()
  48. const numDeliverTxs = 20000
  49. socketFile := fmt.Sprintf("test-%08x.sock", rand.Int31n(1<<30))
  50. defer os.Remove(socketFile)
  51. socket := fmt.Sprintf("unix://%v", socketFile)
  52. // Start the listener
  53. server := abciserver.NewSocketServer(logger.With("module", "abci-server"), socket, app)
  54. t.Cleanup(server.Wait)
  55. err := server.Start(ctx)
  56. require.NoError(t, err)
  57. // Connect to the socket
  58. client := abciclient.NewSocketClient(logger.With("module", "abci-client"), socket, false)
  59. t.Cleanup(client.Wait)
  60. err = client.Start(ctx)
  61. require.NoError(t, err)
  62. done := make(chan struct{})
  63. counter := 0
  64. client.SetResponseCallback(func(req *types.Request, res *types.Response) {
  65. // Process response
  66. switch r := res.Value.(type) {
  67. case *types.Response_DeliverTx:
  68. counter++
  69. if r.DeliverTx.Code != code.CodeTypeOK {
  70. t.Error("DeliverTx failed with ret_code", r.DeliverTx.Code)
  71. }
  72. if counter > numDeliverTxs {
  73. t.Fatalf("Too many DeliverTx responses. Got %d, expected %d", counter, numDeliverTxs)
  74. }
  75. if counter == numDeliverTxs {
  76. go func() {
  77. time.Sleep(time.Second * 1) // Wait for a bit to allow counter overflow
  78. close(done)
  79. }()
  80. return
  81. }
  82. case *types.Response_Flush:
  83. // ignore
  84. default:
  85. t.Error("Unexpected response type", reflect.TypeOf(res.Value))
  86. }
  87. })
  88. // Write requests
  89. for counter := 0; counter < numDeliverTxs; counter++ {
  90. // Send request
  91. _, err = client.DeliverTxAsync(ctx, types.RequestDeliverTx{Tx: []byte("test")})
  92. require.NoError(t, err)
  93. // Sometimes send flush messages
  94. if counter%128 == 0 {
  95. err = client.FlushSync(context.Background())
  96. require.NoError(t, err)
  97. }
  98. }
  99. // Send final flush message
  100. _, err = client.FlushAsync(ctx)
  101. require.NoError(t, err)
  102. <-done
  103. }
  104. //-------------------------
  105. // test grpc
  106. func dialerFunc(ctx context.Context, addr string) (net.Conn, error) {
  107. return tmnet.Connect(addr)
  108. }
  109. func testGRPCSync(ctx context.Context, t *testing.T, logger log.Logger, app types.ABCIApplicationServer) {
  110. t.Helper()
  111. numDeliverTxs := 2000
  112. socketFile := fmt.Sprintf("/tmp/test-%08x.sock", rand.Int31n(1<<30))
  113. defer os.Remove(socketFile)
  114. socket := fmt.Sprintf("unix://%v", socketFile)
  115. // Start the listener
  116. server := abciserver.NewGRPCServer(logger.With("module", "abci-server"), socket, app)
  117. require.NoError(t, server.Start(ctx))
  118. t.Cleanup(func() { server.Wait() })
  119. // Connect to the socket
  120. conn, err := grpc.Dial(socket,
  121. grpc.WithTransportCredentials(insecure.NewCredentials()),
  122. grpc.WithContextDialer(dialerFunc),
  123. )
  124. require.NoError(t, err, "Error dialing GRPC server")
  125. t.Cleanup(func() {
  126. if err := conn.Close(); err != nil {
  127. t.Error(err)
  128. }
  129. })
  130. client := types.NewABCIApplicationClient(conn)
  131. // Write requests
  132. for counter := 0; counter < numDeliverTxs; counter++ {
  133. // Send request
  134. response, err := client.DeliverTx(context.Background(), &types.RequestDeliverTx{Tx: []byte("test")})
  135. require.NoError(t, err, "Error in GRPC DeliverTx")
  136. counter++
  137. if response.Code != code.CodeTypeOK {
  138. t.Error("DeliverTx failed with ret_code", response.Code)
  139. }
  140. if counter > numDeliverTxs {
  141. t.Fatal("Too many DeliverTx responses")
  142. }
  143. t.Log("response", counter)
  144. if counter == numDeliverTxs {
  145. go func() {
  146. time.Sleep(time.Second * 1) // Wait for a bit to allow counter overflow
  147. }()
  148. }
  149. }
  150. }