-
Notifications
You must be signed in to change notification settings - Fork 964
#4574: fix sanity check asyncBatchReadEntries #4579
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
#4574: fix sanity check asyncBatchReadEntries #4579
Conversation
StevenLuMT
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good jobs
|
@mazzucchi-andrea If possible, I think I'd add a startEntry < 0 exception test case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IncorrectParameter seems more precise here
hezhangjian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can startEntry less than zero?
hezhangjian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Done! |
Fix: #4574
Motivation
The little sanity check in the method asyncBatchReadEntries in LedgerHandle does not check if the entrId is equal to or grater
to zero.
Changes
The method validates the input only for
startEntry > lastAddConfirmed. This fix makes it compliant to the other reader methods and validates the input like thisstartEntry < 0 || startEntry > lastAddConfirmed.