Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Handle timeouts when requesting checkpoint headers correctly #743

Merged
merged 3 commits into from
Feb 3, 2019

Conversation

ajsutton
Copy link
Contributor

@ajsutton ajsutton commented Feb 1, 2019

PR description

Fix a NullPointerException when downloading checkpoint headers times out. Add unit tests around CheckpointHeaderManager to improve coverage.

when(blockchain.contains(block(10).getHash())).thenReturn(false);
checkpointHeaderManager.clearImportedCheckpointHeaders();

// The first checkpoint header should always be in the blockchain (just as geneis was present)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is violated in the FastSyncCheckpointManager here when checkpointHeaders is empty. A case that gets handled in the FastSyncChainDownloader here. I think it all works out in the end, but might be a good idea to keep the same invariants in the various checkpoint managers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good spot. I'll fix that in a follow-up PR since I think it's worth getting its own review.

@ajsutton ajsutton merged commit 27522eb into PegaSysEng:master Feb 3, 2019
@ajsutton ajsutton deleted the checkpoint-manager-tests branch February 3, 2019 02:52
rain-on pushed a commit to rain-on/pantheon that referenced this pull request Feb 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants