-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Avoid panic in handleValuePostings #5652
Conversation
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.
Reviewed 1 of 1 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ashish-goswami, @manishrjain, and @vvbalaji-dgraph)
worker/task.go, line 365 at r1 (raw file):
Quoted 4 lines of code…
// calculate(). panic is of the form "index out of range [4] with length 1". We have tried to // reproduce this but couldn't find any edge case which will result in this panic. So for now // we are just logging when srcFn.n != len(q.UidList.Uids) and returning error when this // happens.
shorten this comment, you don't need the last part.
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @manishrjain, @martinmr, and @vvbalaji-dgraph)
worker/task.go, line 365 at r1 (raw file):
Previously, martinmr (Martin Martinez Rivera) wrote…
// calculate(). panic is of the form "index out of range [4] with length 1". We have tried to // reproduce this but couldn't find any edge case which will result in this panic. So for now // we are just logging when srcFn.n != len(q.UidList.Uids) and returning error when this // happens.
shorten this comment, you don't need the last part.
Done.
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @manishrjain, @martinmr, and @vvbalaji-dgraph)
Fixes: DGRAPH-1608 srcFn.n should be equal to len(q.UidList.Uids) for implementation DivideAndRule and calculate to work correctly. But we have seen some panics while forming DataKey in calculate(). panic is of the form "index out of range [4] with length 1". We have tried to reproduce this but couldn't find any edge case which will result in this panic. So for now we are just logging when srcFn.n != len(q.UidList.Uids) and returning error when this happens. (cherry picked from commit 2184268)
Fixes: DGRAPH-1608 srcFn.n should be equal to len(q.UidList.Uids) for implementation DivideAndRule and calculate to work correctly. But we have seen some panics while forming DataKey in calculate(). panic is of the form "index out of range [4] with length 1". We have tried to reproduce this but couldn't find any edge case which will result in this panic. So for now we are just logging when srcFn.n != len(q.UidList.Uids) and returning error when this happens. (cherry picked from commit 2184268)
Fixes: DGRAPH-1608 srcFn.n should be equal to len(q.UidList.Uids) for implementation DivideAndRule and calculate to work correctly. But we have seen some panics while forming DataKey in calculate(). panic is of the form "index out of range [4] with length 1". We have tried to reproduce this but couldn't find any edge case which will result in this panic. So for now we are just logging when srcFn.n != len(q.UidList.Uids) and returning error when this happens.
Fixes: DGRAPH-1608
srcFn.n
should be equal tolen(q.UidList.Uids)
for implementationDivideAndRule
andcalculate
to work correctly. But we have seen some panics while formingDataKey
incalculate()
. panic is of the form"index out of range [4] with length 1"
. We have tried toreproduce this but couldn't find any edge case which will result in this panic. So for now
we are just logging when
srcFn.n != len(q.UidList.Uids)
and returning error when thishappens.
This change is