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

Add null pointer check and testcase for snapsync tasks #7724

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pullurib
Copy link
Contributor

@pullurib pullurib commented Oct 4, 2024

PR description

Added a null pointer check where a null pointer exception was thrown as described in the issue
Added a testcase to verify the case is handled gracefully

taskElement shouldn't be null ideally as it's only added to trie after validating proofs and we get to this point after checking if data is available and isValidProof is true.

  • A race condition between calling addResponse(requestDataStep) and getChildRequests(persistDataStep) seems unlikely as they are sequential in pipeline and synchronized by setting isValidProof after adding taskElement and checked before accessing taskElement.
  • Clear() on the request also sets isValidProof to false before removing the element from Trie.

Fixed Issue(s)

#6113

@macfarla macfarla requested a review from matkt October 9, 2024 03:40
Copy link
Contributor

@lu-pinto lu-pinto left a comment

Choose a reason for hiding this comment

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

LGTM

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