From f4a363dc1ee8dd9020526c3f1be60b78b151241a Mon Sep 17 00:00:00 2001 From: Elijah Carrel Date: Thu, 19 Jan 2023 16:23:55 -0800 Subject: [PATCH 1/2] parameterize the timeout length in vrpc --- x/ref/cmd/vrpc/vrpc.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/x/ref/cmd/vrpc/vrpc.go b/x/ref/cmd/vrpc/vrpc.go index 0f86434bf..87d633e75 100644 --- a/x/ref/cmd/vrpc/vrpc.go +++ b/x/ref/cmd/vrpc/vrpc.go @@ -39,6 +39,7 @@ var ( flagShowReserved bool flagShallowResolve bool flagJSON bool + flagTimeout time.Duration insecureOpts = []rpc.CallOpt{ options.ServerAuthorizer{Authorizer: security.AllowEveryone()}, options.NameResolutionAuthorizer{Authorizer: security.AllowEveryone()}, @@ -63,6 +64,7 @@ func init() { cmdVRPC.Flags.BoolVar(&flagShallowResolve, "s", false, "if true, perform a shallow resolve") cmdVRPC.Flags.BoolVar(&flagJSON, "json", false, "if true, output a JSON representation of the response") + cmdVRPC.Flags.DurationVar(&flagTimeout, "timeout", time.Minute, "time to wait for response to succeed before failing with a timeout error") } var cmdVRPC = &cmdline.Command{ @@ -185,7 +187,7 @@ func runSignature(ctx *context.T, env *cmdline.Env, args []string) error { } // Get the interface or method signature, and pretty-print. We print the // named types after the signatures, to aid in readability. - ctx, cancel := context.WithTimeout(ctx, time.Minute) + ctx, cancel := context.WithTimeout(ctx, flagTimeout) defer cancel() var types vdlgen.NamedTypes opts, err := rpcOpts(ctx, server) @@ -243,7 +245,7 @@ func runCall(ctx *context.T, env *cmdline.Env, args []string) error { //nolint:g return err } // Get the method signature and parse args. - ctx, cancel := context.WithTimeout(ctx, time.Minute) + ctx, cancel := context.WithTimeout(ctx, flagTimeout) defer cancel() methodSig, err := reserved.MethodSignature(ctx, server, method, opts...) if err != nil { @@ -329,7 +331,7 @@ func runIdentify(ctx *context.T, env *cmdline.Env, args []string) error { return env.UsageErrorf("wrong number of arguments") } server := args[0] - ctx, cancel := context.WithTimeout(ctx, time.Minute) + ctx, cancel := context.WithTimeout(ctx, flagTimeout) defer cancel() opts, err := rpcOpts(ctx, server) if err != nil { From e1f48cef7b01b3730c95545d65f09c9c848a9505 Mon Sep 17 00:00:00 2001 From: Elijah Carrel Date: Wed, 1 Mar 2023 16:12:19 -0800 Subject: [PATCH 2/2] use deeper logging level for side channel log statement --- x/ref/runtime/internal/flow/manager/manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/ref/runtime/internal/flow/manager/manager.go b/x/ref/runtime/internal/flow/manager/manager.go index 1d0a189ab..af1b4a9d9 100644 --- a/x/ref/runtime/internal/flow/manager/manager.go +++ b/x/ref/runtime/internal/flow/manager/manager.go @@ -855,7 +855,7 @@ func (m *manager) internalDial( if sideChannelChan == sc { cached = c if i > 0 { - ctx.Infof("internalDial: side channel for %v, conn %p, index: %v", remote, c, i) + ctx.VI(1).Infof("internalDial: side channel for %v, conn %p, index: %v", remote, c, i) } break }