From ccf7beb5f7ecfc741605866b3677aa08bce372e2 Mon Sep 17 00:00:00 2001 From: Raul Jordan Date: Sun, 21 Apr 2019 15:49:57 -0500 Subject: [PATCH] Prevent Canceling Goroutines in Validator Client (#2324) * do not cancel assignments goroutines * exclude rule * disable lostcancel for now --- BUILD.bazel | 2 +- nogo_config.json | 6 +++++- validator/client/runner.go | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel index 1dd28f288..60908f04c 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -68,7 +68,7 @@ nogo( "@org_golang_x_tools//go/analysis/passes/pkgfact:go_tool_library", "@org_golang_x_tools//go/analysis/passes/nilness:go_tool_library", "@org_golang_x_tools//go/analysis/passes/nilfunc:go_tool_library", - "@org_golang_x_tools//go/analysis/passes/lostcancel:go_tool_library", + # "@org_golang_x_tools//go/analysis/passes/lostcancel:go_tool_library", "@org_golang_x_tools//go/analysis/passes/loopclosure:go_tool_library", "@org_golang_x_tools//go/analysis/passes/httpresponse:go_tool_library", "@org_golang_x_tools//go/analysis/passes/findcall:go_tool_library", diff --git a/nogo_config.json b/nogo_config.json index d971abecf..2faae18d2 100644 --- a/nogo_config.json +++ b/nogo_config.json @@ -10,6 +10,11 @@ "external/*": "Unreachable third party code" } }, + "lostcancel": { + "exclude_files": { + "validator/client/runner.go": "No need to cancel right when goroutines begin" + } + }, "nilness": { "exclude_files": { "external/*": "Third party code" @@ -44,6 +49,5 @@ "exclude_files": { "external/*": "Third party code" } - } } diff --git a/validator/client/runner.go b/validator/client/runner.go index 83a804984..fda25f50c 100644 --- a/validator/client/runner.go +++ b/validator/client/runner.go @@ -100,7 +100,6 @@ func run(ctx context.Context, v Validator) { }(role, id) } - cancel() } } }