vmware / vmware-go-kcl-v2

vmware-go-kcl is a vmware originated open-source project for AWS Kinesis Client Library in Go. It has been widely used by many external companies and internally by Carbon Black. vmware-go-kcl-v2 is its companion project by utilizing AWS Go SDK V2 which introduces lots of breaking changes. To keep the repo clean, it is better to have a separated repo vmware-go-kcl-v2 with better golang project structure improvement.
MIT License
23 stars 17 forks source link

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

Closed spentakota closed 1 year ago

spentakota commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

@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.