service: plumb contexts to all (most) threads (#7363)

This continues the push of plumbing contexts through tendermint. I
attempted to find all goroutines in the production code (non-test) and
made sure that these threads would exit when their contexts were
canceled, and I believe this PR does that.
This commit is contained in:
Sam Kleinman
2021-12-02 21:38:38 +00:00
committed by GitHub
parent b3be1d7d7a
commit 8a991e288c
64 changed files with 964 additions and 727 deletions
+4
View File
@@ -246,6 +246,10 @@ func startSigner(ctx context.Context, cfg *Config) error {
if err := s.Serve(lis); err != nil {
panic(err)
}
go func() {
<-ctx.Done()
s.GracefulStop()
}()
}()
return nil
+1 -2
View File
@@ -319,8 +319,7 @@ Does not run any perbutations.
lctx, loadCancel := context.WithCancel(ctx)
defer loadCancel()
go func() {
err := Load(lctx, r, cli.testnet)
chLoadResult <- err
chLoadResult <- Load(lctx, r, cli.testnet)
}()
if err := Start(ctx, cli.testnet); err != nil {