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

fix: catch DynamoDB Scan error when trying to scan nonexistent table or index #16

Merged
merged 2 commits into from
Dec 19, 2022

Conversation

spentakota
Copy link
Contributor

When trying to integrate the vmware-go-kcl-v2 within one of our codebases a bug was identified by our one of our end to end tests that causes for a nil pointer error. This occurs when the rebalance() function is called when no checkpoint has been set for any of the shards so when syncLeases() is called the dynamoDB scan will return a scanOutput.items which is nil causing for the nil pointer error. This can be avoided if we check for any errors returned from the checkpointer.svc.Scan() call. According to the AWS documentation, the case being described will return a ResourceNotFoundExceptionerror which can now be caught and the function can return with the error with this fix.

@vmwclabot
Copy link
Member

@spentakota, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@vmwclabot
Copy link
Member

@spentakota, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

…index in syncLeases()

Signed-off-by: Shiva Pentakota <spentakota@vmware.com>
@vmwclabot
Copy link
Member

@spentakota, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

Signed-off-by: Shiva Pentakota <spentakota@vmware.com>
@spentakota spentakota force-pushed the spentakota_catchNilErrorSyncLeases branch from 6578fdc to 09cc589 Compare December 17, 2022 00:03
@spentakota spentakota merged commit 4afa8fe into main Dec 19, 2022
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.

None yet

2 participants