You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Move concurrent connection dial limit out of healthcheck.
There's a concurrent connection dial limit implemented in the healthcheck code that doesn't semantically or logically belong here.
First, the healthcheck code does neither know nor care about the network protocol used to execute healthchecks. Arguably, there's no other protocol used for this apart from `grpc`, but it seems wrong to set up a `grpc` connection specific options in the healthcheck code.
Additionally, the dial concurrency limit modifies the global `grpc` connection options the first time a healthcheck is started. That seems unexpected, and I believe we want the concurrency limit set for all `grpc`` dial operations, irrespective of whether those connections are used for healtchecking or anything else.
This change moves the concurrency limit into the `grpcclient` package, and sets it on any `grpc` connection opened via that package.
Signed-off-by: Arthur Schreiber <[email protected]>
// refreshKnownTablets tells us whether to process all tablets or only new tablets.
93
92
refreshKnownTablets=true
94
93
95
-
// healthCheckDialConcurrency tells us how many healthcheck connections can be opened to tablets at once. This should be less than the golang max thread limit of 10000.
fs.StringVar(&TabletURLTemplateString, "tablet_url_template", "http://{{.GetTabletHostPort}}", "Format string describing debug tablet url formatting. See getTabletDebugURL() for how to customize this.")
fs.BoolVar(&refreshKnownTablets, "tablet_refresh_known_tablets", true, "Whether to reload the tablet's address/port map from topo in case they change.")
180
-
fs.Int64Var(&healthCheckDialConcurrency, "healthcheck-dial-concurrency", 1024, "Maximum concurrency of new healthcheck connections. This should be less than the golang max thread limit of 10000.")
181
176
ParseTabletURLTemplateFromFlag()
182
177
}
183
178
@@ -297,8 +292,6 @@ type HealthCheckImpl struct {
297
292
subscribersmap[chan*TabletHealth]struct{}
298
293
// loadTablets trigger is used to immediately load a new primary tablet when the current one has been demoted
299
294
loadTabletsTriggerchanstruct{}
300
-
// healthCheckDialSem is used to limit how many healthcheck connections can be opened to tablets at once.
301
-
healthCheckDialSem*semaphore.Weighted
302
295
}
303
296
304
297
// NewHealthCheck creates a new HealthCheck object.
fs.StringVar(&credsFile, "grpc_auth_static_client_creds", credsFile, "When using grpc_static_auth in the server, this file provides the credentials to use to authenticate with server.")
// TODO: Deprecate this and rename it to `grpc-dial-concurrency-limit`
85
+
fs.Int64Var(&dialConcurrencyLimit, "healthcheck-dial-concurrency", 1024, "Maximum concurrency of new healthcheck connections. This should be less than the golang max thread limit of 10000.")
fs.Int64Var(&dialConcurrencyLimit, "grpc-dial-concurrency-limit", 1024, "Maximum concurrency of grpc dial operations. This should be less than the golang max thread limit of 10000.")
0 commit comments