diff --git a/cmd/lotus-pcr/main.go b/cmd/lotus-pcr/main.go index 8c1cca05b..c98829bd2 100644 --- a/cmd/lotus-pcr/main.go +++ b/cmd/lotus-pcr/main.go @@ -421,7 +421,12 @@ var runCmd = &cli.Command{ }, Action: func(cctx *cli.Context) error { go func() { - _ = http.ListenAndServe(":6060", nil) + server := &http.Server{ + Addr: ":6060", + ReadHeaderTimeout: 3 * time.Second, + } + + _ = server.ListenAndServe() }() ctx := context.Background() diff --git a/cmd/lotus-shed/itestd.go b/cmd/lotus-shed/itestd.go index 3ac542d27..2e70a9fcd 100644 --- a/cmd/lotus-shed/itestd.go +++ b/cmd/lotus-shed/itestd.go @@ -9,6 +9,7 @@ import ( "net/http/httptest" "os" "os/exec" + "time" "github.com/chzyer/readline" "github.com/urfave/cli/v2" @@ -46,7 +47,7 @@ var itestdCmd = &cli.Command{ } s := &httptest.Server{ Listener: l, - Config: &http.Server{Handler: m}, + Config: &http.Server{Handler: m, ReadHeaderTimeout: 3 * time.Second}, } s.Start() fmt.Printf("ITest env:\n\nLOTUS_ITESTD=%s\n\nSay 'sh' to spawn a shell connected to test nodes\n--- waiting for clients\n", s.URL) diff --git a/cmd/lotus-shed/msig.go b/cmd/lotus-shed/msig.go index 7d37d3d2d..ccc932c93 100644 --- a/cmd/lotus-shed/msig.go +++ b/cmd/lotus-shed/msig.go @@ -121,6 +121,10 @@ var multisigGetAllCmd = &cli.Command{ } return nil }) + if err != nil { + return err + } + out, err := json.MarshalIndent(msigActorsInfo, "", " ") if err != nil { return err diff --git a/itests/kit/rpc.go b/itests/kit/rpc.go index 684742ad3..badd068d7 100644 --- a/itests/kit/rpc.go +++ b/itests/kit/rpc.go @@ -7,6 +7,7 @@ import ( "net/http" "net/http/httptest" "testing" + "time" "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" @@ -22,7 +23,10 @@ type Closer func() func CreateRPCServer(t *testing.T, handler http.Handler, listener net.Listener) (*httptest.Server, multiaddr.Multiaddr, Closer) { testServ := &httptest.Server{ Listener: listener, - Config: &http.Server{Handler: handler}, + Config: &http.Server{ + Handler: handler, + ReadHeaderTimeout: 3 * time.Second, + }, } testServ.Start() diff --git a/itests/migration_nv17_test.go b/itests/migration_nv17_test.go index 4bf453d6f..1b0d13ae1 100644 --- a/itests/migration_nv17_test.go +++ b/itests/migration_nv17_test.go @@ -199,6 +199,7 @@ func TestMigrationNV17(t *testing.T) { require.NoError(t, err) sig, err := clientApi.WalletSign(ctx, verifiedClientAddr, serializedProposal.Bytes()) + require.NoError(t, err) publishDealParams := markettypes.PublishStorageDealsParams{ Deals: []markettypes.ClientDealProposal{{ @@ -405,6 +406,7 @@ func TestMigrationNV17(t *testing.T) { require.NoError(t, err) sig, err = clientApi.WalletSign(ctx, verifiedClientAddr, serializedProposal.Bytes()) + require.NoError(t, err) publishDealParams = markettypes.PublishStorageDealsParams{ Deals: []markettypes.ClientDealProposal{{ diff --git a/lib/consensus/raft/raft.go b/lib/consensus/raft/raft.go index 77afc8595..9cfd41a4a 100644 --- a/lib/consensus/raft/raft.go +++ b/lib/consensus/raft/raft.go @@ -284,7 +284,7 @@ func (rw *raftWrapper) WaitForLeader(ctx context.Context) (string, error) { func (rw *raftWrapper) WaitForVoter(ctx context.Context) error { logger.Debug("waiting until we are promoted to a voter") - pid := hraft.ServerID(peer.Encode(rw.host.ID())) + pid := hraft.ServerID(rw.host.ID().String()) for { select { case <-ctx.Done():