Skip to content

Conversation

@tsachiherman
Copy link
Contributor

Summary

Existing implementation was not stopping the KMD in case we have failed to stop algod. This is wrong. A call to NodeController.FullStop should stop both of them, and return an error if it's unable to do so.

The concrete use case here was that algod has crashed while kmd remained in memory. Calling the above FullStop() failed since the algod was already gone, and therefore would not attempt to stop kmd.

Test Plan

This issue was uncovered by the expect node test.

@tsachiherman tsachiherman self-assigned this May 20, 2021
@tsachiherman tsachiherman changed the title bugfix: ensure stopping node stops kmd bugfix: ensure stopping a node always stops kmd May 20, 2021
Copy link
Contributor

@algonautshant algonautshant left a comment

Choose a reason for hiding this comment

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

Looks great.

errAlgod := nc.StopAlgod()
kmdAlreadyStopped, err = nc.StopKMD()
if errAlgod != nil {
err = errAlgod
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like we are ignoring the kmd error if algod has an error.
Maybe this if fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that using a composite error here would only be more complicated, and not really that more useful.

@tsachiherman tsachiherman merged commit 58f59e3 into algorand:master May 20, 2021
@tsachiherman tsachiherman deleted the tsachi/fixgoalnodetest branch May 20, 2021 19:08
tsachiherman added a commit to tsachiherman/go-algorand that referenced this pull request Jul 7, 2021
Existing implementation was not stopping the KMD in case we have failed to stop `algod`. This is wrong. A call to `NodeController.FullStop` should stop both of them, and return an error if it's unable to do so.

The concrete use case here was that algod has crashed while kmd remained in memory. Calling the above `FullStop()` failed since the `algod` was already gone, and therefore would not attempt to stop `kmd`.
@tsachiherman tsachiherman restored the tsachi/fixgoalnodetest branch August 16, 2021 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants