This commit is contained in:
Łukasz Magiera 2020-08-18 18:27:28 +02:00
parent baf91f08a1
commit e7d65be90a
7 changed files with 20 additions and 22 deletions

View File

@ -13,7 +13,7 @@ import (
)
var pprofCmd = &cli.Command{
Name: "pprof",
Name: "pprof",
Hidden: true,
Subcommands: []*cli.Command{
PprofGoroutines,
@ -42,7 +42,7 @@ var PprofGoroutines = &cli.Command{
return err
}
addr = "http://" + addr + "/debug/pprof/goroutine?debug=2"
addr = "http://" + addr + "/debug/pprof/goroutine?debug=2"
r, err := http.Get(addr)
if err != nil {
@ -56,4 +56,3 @@ var PprofGoroutines = &cli.Command{
return r.Body.Close()
},
}

View File

@ -9,7 +9,7 @@ import (
)
var configCmd = &cli.Command{
Name: "config",
Name: "config",
Usage: "Output default configuration",
Action: func(cctx *cli.Context) error {
comm, err := config.ConfigComment(config.DefaultStorageMiner())

View File

@ -70,12 +70,12 @@ func TestHappyPath(t *testing.T) {
func TestSeedRevert(t *testing.T) {
ma, _ := address.NewIDAddress(55151)
m := test{
s: &Sealing{
maddr: ma,
stats: SectorStats{
bySector: map[abi.SectorID]statSectorState{},
},
},
s: &Sealing{
maddr: ma,
stats: SectorStats{
bySector: map[abi.SectorID]statSectorState{},
},
},
t: t,
state: &SectorInfo{State: Packing},
}
@ -117,12 +117,12 @@ func TestSeedRevert(t *testing.T) {
func TestPlanCommittingHandlesSectorCommitFailed(t *testing.T) {
ma, _ := address.NewIDAddress(55151)
m := test{
s: &Sealing{
maddr: ma,
stats: SectorStats{
bySector: map[abi.SectorID]statSectorState{},
},
},
s: &Sealing{
maddr: ma,
stats: SectorStats{
bySector: map[abi.SectorID]statSectorState{},
},
},
t: t,
state: &SectorInfo{State: Committing},
}

View File

@ -13,4 +13,3 @@ type Config struct {
WaitDealsDelay time.Duration
}

View File

@ -297,7 +297,7 @@ func (m *Sealing) newDealSector() (abi.SectorNumber, error) {
var best abi.SectorNumber = math.MaxUint64
for sn, info := range m.unsealedInfoMap.infos {
if info.stored + 1 > mostStored + 1 { // 18446744073709551615 + 1 = 0
if info.stored+1 > mostStored+1 { // 18446744073709551615 + 1 = 0
best = sn
}
}

View File

@ -7,6 +7,7 @@ import (
)
type statSectorState int
const (
sstSealing statSectorState = iota
sstFailed
@ -18,7 +19,7 @@ type SectorStats struct {
lk sync.Mutex
bySector map[abi.SectorID]statSectorState
totals [nsst]uint64
totals [nsst]uint64
}
func (ss *SectorStats) updateSector(id abi.SectorID, st SectorState) {
@ -35,7 +36,6 @@ func (ss *SectorStats) updateSector(id abi.SectorID, st SectorState) {
ss.totals[sst]++
}
// return the number of sectors currently in the sealing pipeline
func (ss *SectorStats) curSealing() uint64 {
ss.lk.Lock()

View File

@ -139,11 +139,11 @@ func DefaultFullNode() *FullNode {
func DefaultStorageMiner() *StorageMiner {
cfg := &StorageMiner{
Common: defCommon(),
Sealing: SealingConfig{
MaxWaitDealsSectors: 2, // 64G with 32G sectors
MaxSealingSectors: 0,
WaitDealsDelay: Duration(time.Hour),
WaitDealsDelay: Duration(time.Hour),
},
Storage: sectorstorage.SealerConfig{