Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2023-09-06 12:58:05 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2023-09-07 09:34:27 +0300
commiteeffe3ea0a7d6f019b1c4d8de037325e6ffc137f (patch)
treee3b5f9d50ebc85cc2c039cdf98e218ad9d736fd1
parent154617c26466a8e14ed14beb149a0e80f752878b (diff)
client: Move `FailOnNonTempDialError` logic into internal package
Move the `FailOnNonTempDialError` logic into our internal client package. Like this we can reuse the functionality internally without having to rely on our public interface, which allows us to iterate on its internal implementation without breaking the public API.
-rw-r--r--client/dial.go5
-rw-r--r--internal/grpc/client/dial.go8
2 files changed, 9 insertions, 4 deletions
diff --git a/client/dial.go b/client/dial.go
index e552e6f6a..3bc103b4c 100644
--- a/client/dial.go
+++ b/client/dial.go
@@ -46,10 +46,7 @@ func DialSidechannel(ctx context.Context, rawAddress string, sr *SidechannelRegi
// FailOnNonTempDialError helps to identify if remote listener is ready to accept new connections.
func FailOnNonTempDialError() []grpc.DialOption {
- return []grpc.DialOption{
- grpc.WithBlock(),
- grpc.FailOnNonTempDialError(true),
- }
+ return client.FailOnNonTempDialError()
}
// HealthCheckDialer uses provided dialer as an actual dialer, but issues a health check request to the remote
diff --git a/internal/grpc/client/dial.go b/internal/grpc/client/dial.go
index f0a26576a..a4f076c3a 100644
--- a/internal/grpc/client/dial.go
+++ b/internal/grpc/client/dial.go
@@ -250,6 +250,14 @@ func defaultServiceConfig() string {
return string(configJSON)
}
+// FailOnNonTempDialError helps to identify if remote listener is ready to accept new connections.
+func FailOnNonTempDialError() []grpc.DialOption {
+ return []grpc.DialOption{
+ grpc.WithBlock(),
+ grpc.FailOnNonTempDialError(true),
+ }
+}
+
// HealthCheckDialer uses provided dialer as an actual dialer, but issues a health check request to the remote
// to verify the connection was set properly and could be used with no issues.
func HealthCheckDialer(base Dialer) Dialer {