From b363bc3e70b8b36b546526e33722b2a630eed5fd Mon Sep 17 00:00:00 2001 From: "Andrew Jackson (Ajax)" Date: Thu, 14 Dec 2023 18:13:44 -0600 Subject: [PATCH] fix lp blocking --- cmd/lotus-provider/deps/deps.go | 11 ++++++----- cmd/lotus-provider/main.go | 2 +- cmd/lotus-provider/tasks/tasks.go | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cmd/lotus-provider/deps/deps.go b/cmd/lotus-provider/deps/deps.go index 9a0a3691f..499cc7bec 100644 --- a/cmd/lotus-provider/deps/deps.go +++ b/cmd/lotus-provider/deps/deps.go @@ -11,14 +11,18 @@ import ( "net/http" "strings" + "github.com/BurntSushi/toml" + "github.com/gbrlsnchs/jwt/v3" ds "github.com/ipfs/go-datastore" dssync "github.com/ipfs/go-datastore/sync" logging "github.com/ipfs/go-log/v2" + "github.com/urfave/cli/v2" + "golang.org/x/xerrors" - "github.com/BurntSushi/toml" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-jsonrpc/auth" "github.com/filecoin-project/go-statestore" + "github.com/filecoin-project/lotus/api" cliutil "github.com/filecoin-project/lotus/cli/util" "github.com/filecoin-project/lotus/journal" @@ -34,9 +38,6 @@ import ( "github.com/filecoin-project/lotus/storage/sealer" "github.com/filecoin-project/lotus/storage/sealer/ffiwrapper" "github.com/filecoin-project/lotus/storage/sealer/storiface" - "github.com/gbrlsnchs/jwt/v3" - "github.com/urfave/cli/v2" - "golang.org/x/xerrors" ) var log = logging.Logger("lotus-provider/deps") @@ -164,7 +165,7 @@ func (deps *Deps) PopulateRemainingDeps(ctx context.Context, cctx *cli.Context, if err != nil { return err } - defer func() { + go func() { <-ctx.Done() _ = j.Close() }() diff --git a/cmd/lotus-provider/main.go b/cmd/lotus-provider/main.go index 18b2e87f3..a6c79b6de 100644 --- a/cmd/lotus-provider/main.go +++ b/cmd/lotus-provider/main.go @@ -29,7 +29,7 @@ func SetupCloseHandler() { go func() { <-c fmt.Println("\r- Ctrl+C pressed in Terminal") - pprof.Lookup("goroutine").WriteTo(os.Stdout, 1) + _ = pprof.Lookup("goroutine").WriteTo(os.Stdout, 1) panic(1) }() } diff --git a/cmd/lotus-provider/tasks/tasks.go b/cmd/lotus-provider/tasks/tasks.go index 18c56a744..2c4cd58bf 100644 --- a/cmd/lotus-provider/tasks/tasks.go +++ b/cmd/lotus-provider/tasks/tasks.go @@ -5,13 +5,13 @@ import ( "context" logging "github.com/ipfs/go-log/v2" + "github.com/samber/lo" "github.com/filecoin-project/lotus/cmd/lotus-provider/deps" "github.com/filecoin-project/lotus/lib/harmony/harmonytask" "github.com/filecoin-project/lotus/provider" "github.com/filecoin-project/lotus/provider/lpmessage" "github.com/filecoin-project/lotus/provider/lpwinning" - "github.com/samber/lo" ) var log = logging.Logger("lotus-provider/deps")