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

fix(manager): revert the sectors abort command #853

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,36 +114,44 @@ var utilSealerSectorsAbortCmd = &cli.Command{
Name: "abort",
Usage: "Abort specified online sector job",
ArgsUsage: "<miner actor> <sector number>",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "really-do-it",
Usage: "WARNING: This command may result in inconsistent state of damocles-manager and damocles-worker. If you know what you're doing, use it",
Value: false,
},
},
Action: func(cctx *cli.Context) error {
return fmt.Errorf("this command is not available in the current version, please use the `damocles-worker worker -c <config file path> resume --state Aborted --index <index>` or `damocles-manager util worker resume <worker instance name or address> <thread index> Aborted` commands instead.\n See: https://github.com/ipfs-force-community/damocles/blob/main/docs/en/11.task-status-flow.md#1-for-a-sector-sealing-task-that-has-been-paused-due-to-an-error-and-cannot-be-resumed-such-as-the-ticket-has-expired-you-can-use")
// if count := cctx.Args().Len(); count < 2 {
// return fmt.Errorf("both miner actor id & sector number are required, only %d args provided", count)
// }

// miner, err := ShouldActor(cctx.Args().Get(0), true)
// if err != nil {
// return fmt.Errorf("invalid miner actor id: %w", err)
// }

// sectorNum, err := strconv.ParseUint(cctx.Args().Get(1), 10, 64)
// if err != nil {
// return fmt.Errorf("invalid sector number: %w", err)
// }

// cli, gctx, stop, err := extractAPI(cctx)
// if err != nil {
// return err
// }

// defer stop()

// _, err = cli.Sealer.ReportAborted(gctx, abi.SectorID{
// Miner: miner,
// Number: abi.SectorNumber(sectorNum),
// }, "aborted via CLI")
// if err != nil {
// return fmt.Errorf("abort sector failed: %w", err)
// }
// return fmt.Errorf("this command is not available in the current version, please use the `damocles-worker worker -c <config file path> resume --state Aborted --index <index>` or `damocles-manager util worker resume <worker instance name or address> <thread index> Aborted` commands instead.\n See: https://github.com/ipfs-force-community/damocles/blob/main/docs/en/11.task-status-flow.md#1-for-a-sector-sealing-task-that-has-been-paused-due-to-an-error-and-cannot-be-resumed-such-as-the-ticket-has-expired-you-can-use")
if count := cctx.Args().Len(); count < 2 {
return fmt.Errorf("both miner actor id & sector number are required, only %d args provided", count)
}

miner, err := ShouldActor(cctx.Args().Get(0), true)
if err != nil {
return fmt.Errorf("invalid miner actor id: %w", err)
}

sectorNum, err := strconv.ParseUint(cctx.Args().Get(1), 10, 64)
if err != nil {
return fmt.Errorf("invalid sector number: %w", err)
}

cli, gctx, stop, err := extractAPI(cctx)
if err != nil {
return err
}

defer stop()

_, err = cli.Damocles.ReportAborted(gctx, abi.SectorID{
Miner: miner,
Number: abi.SectorNumber(sectorNum),
}, "aborted via CLI")
if err != nil {
return fmt.Errorf("abort sector failed: %w", err)
}
return nil
},
}

Expand Down
Loading