Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore resend SectorStartPacking event. and fix StartPacking's unsealedInfoMap lock #3374

Merged

Conversation

IPFSMain-Official
Copy link

I once encountered StartPacking twice, causing the state machine to stop in error. And SectorAddPiece and SectorStartPacking are triggered simultaneously, causing the state machine to receive two events.This change should solve both of these problems.

planner for state Packing only has a plan for a single event only, got [{User:{NewPiece:{Piece:{Size:134217728 PieceCID:baga6ea4seaqc2k4bizwrswlo3l6wefxfu2ddktxnmzjv5vdpmx7qjhhgemagyfy} DealInfo:0xc0384a7740}}} {User:{FillerPieces:[{Size:268435456 PieceCID:baga6ea4seaqk2bufhfu5g7ju74eobh2wsmfevum2rhppmdf75z7b2m4byhtryny} {Size:536870912 PieceCID:baga6ea4seaqdsvqopmj2soyhujb72jza76t4wpq5fzifvm3ctz47iyytkewnubq} {Size:1073741824 PieceCID:baga6ea4seaqmzq6acl23axubdiv37xipnaz3qqtvwr57ekoaauviescphqnfwpi} {Size:2147483648 PieceCID:baga6ea4seaqh34u3nf3tdgpi6k2aw54rtucikcpo25uofrzjpmprinydj7b4mla} {Size:4294967296 PieceCID:baga6ea4seaqgntqfunthkuwpixacxtcoqojjdg66vq254l7vmjyyjdu7pntvcby} {Size:8589934592 PieceCID:baga6ea4seaqnqyicdbbfvnpjlmokmi45fgroiigxa2uw6nz6f6ojveoxlhizwai} {Size:17179869184 PieceCID:baga6ea4seaqg2nsld34emra2ljfgrbrdcswmbjdpaftrpzjuipudt3w7qpbikpa}]}}]:
github.com/filecoin-project/lotus/extern/storage-sealing.planOne.func1
/home/rc/filecoin-project-amd/lotus/extern/storage-sealing/fsm.go:390

@magik6k magik6k self-requested a review August 28, 2020 14:34
@magik6k
Copy link
Contributor

magik6k commented Aug 28, 2020

Thanks!

@magik6k magik6k merged commit a7ef612 into filecoin-project:master Aug 28, 2020
m.unsealedInfoMap.lk.Lock()
defer m.unsealedInfoMap.lk.Unlock()

// cannot send SectorStartPacking to sectors that have already been packed, otherwise it will cause the state machine to exit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This...shouldn't have been a problem, since the FSM's planOne should safely skip an unexpected SectorStartPacking event, since it's an Ignorable.

(Don't see anything wrong with adding this check, though)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants