Skip to content

Conversation

@aarongable
Copy link
Contributor

Dry run stubs for the SA's override and pausing methods were not added when this functionality was added to the admin tool. This means that attempts to run these subcommands in dry-run mode result in nil pointer exceptions when it tries to call unimplemented methods on the dryRunSAC.

Fixes #8577

@aarongable aarongable marked this pull request as ready for review January 21, 2026 17:35
@aarongable aarongable requested a review from a team as a code owner January 21, 2026 17:35
@aarongable aarongable requested a review from jsha January 21, 2026 17:35
Copy link
Contributor

@jsha jsha left a comment

Choose a reason for hiding this comment

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

Comparing to #8588, this could use an implements assertion for dryRunSAC:

var _ rapb.StorageAuthorityClient = (*dryRunSAC)(nil)

@aarongable
Copy link
Contributor Author

Comparing to #8588, this could use an implements assertion for dryRunSAC:

var _ rapb.StorageAuthorityClient = (*dryRunSAC)(nil)

It could, but it doesn't accomplish anything. The dryRunSAC struct embeds the rapb.StorageAuthorityClient interface, so it trivially implements the interface despite some of those "implementations" being nil pointers:

type dryRunSAC struct {
sapb.StorageAuthorityClient

The interface assertion would be valuable if we removed that embedding, but then we'd have to actually stub out all the other methods in the StorageAuthorityClient interface, too.

@jsha
Copy link
Contributor

jsha commented Jan 22, 2026

Perhaps, then, admin.go should define its own interface that is the subset of SA methods it uses? Then dryRunSAC could remove the embedding and still implement the interface that admin.go needs. That would allow us to catch future instances of this mistake at compile time.

@aarongable
Copy link
Contributor Author

Yeah that makes sense. I've added stripped down interfaces that are re-implemented by the dryrun structs.

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.

Panic while dry-run of admin tool

3 participants