{"record":{"id":"c0f788fa4c3b6378","repo":"vitessio/vitess","slug":"value-must-be-either-a-float64-interpreted-as-sec","errorCode":null,"errorMessage":"value must be either a float64 (interpreted as seconds) or a valid time.Duration","messagePattern":"value must be either a float64 \\(interpreted as seconds\\) or a valid time\\.Duration","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"go/flagutil/float_to_duration.go","lineNumber":55,"sourceCode":"}\n\n// Set parses the input and updates the duration\nfunc (f *FloatOrDuration) Set(value string) error {\n\t// Try to parse as float64 first (interpreted as seconds)\n\tif floatVal, err := strconv.ParseFloat(value, 64); err == nil {\n\t\tf.Duration = time.Duration(floatVal * float64(time.Second))\n\t\t*f.Target = f.Duration // Update the target pointer\n\t\treturn nil\n\t}\n\n\t// Try to parse as time.Duration\n\tif duration, err := time.ParseDuration(value); err == nil {\n\t\tf.Duration = duration\n\t\t*f.Target = f.Duration // Update the target pointer\n\t\treturn nil\n\t}\n\n\treturn errors.New(\"value must be either a float64 (interpreted as seconds) or a valid time.Duration\")\n}\n\n// Type returns the type description\nfunc (f *FloatOrDuration) Type() string {\n\treturn \"time.Duration\"\n}\n\n// FloatDuration defines a flag with the specified name, default value, and usage string and binds it to a time.Duration variable.\nfunc FloatDuration(fs *pflag.FlagSet, p *time.Duration, name string, defaultValue time.Duration, usage string) {\n\t*p = defaultValue\n\tfd := FloatOrDuration{\n\t\tTarget:   p,\n\t\tDuration: defaultValue,\n\t}\n\tfs.Var(&fd, name, usage)\n}\n","sourceCodeStart":37,"sourceCodeEnd":72,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/flagutil/float_to_duration.go#L37-L72","documentation":"Cluster.GetSrvVSchema acquires topoReadPool before reading the per-cell SrvVSchema from vtctld. If the pool acquisition fails (context cancelled or timed out waiting for a slot), the call returns this wrapped error instead of querying.","triggerScenarios":"Calling Cluster.GetSrvVSchema for a cell while topoReadPool is saturated and ctx expires during Acquire.","commonSituations":"Many concurrent vschema/topo reads; slow etcd/zookeeper causing long pool waits; aggressive client timeouts.","solutions":["Retry the request","Raise the topo read pool size or lower concurrency of callers","Investigate topo server latency that keeps pool slots occupied"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"sv, err := cluster.GetSrvVSchema(ctx, cell)\nif err != nil && errors.Is(err, context.DeadlineExceeded) {\n\t// pool contention; retry with backoff or larger deadline\n\tsv, err = cluster.GetSrvVSchema(ctx2, cell)\n}","preventionTips":["Avoid bursting many concurrent per-cell topo reads","Increase topoReadPool capacity in busy deployments","Watch topo backend latency"],"tags":["vtadmin","topology","concurrency","vschema"],"backgroundTag":"semaphore-acquire-timeout","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}