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 DynamoDB checkpointer scan error hanlding #11

Closed kolesnikovae closed 1 year ago

kolesnikovae commented 2 years ago

The PR fixes panic in DynamoDB checkpointer caused by nil pointer dereference:

    /go/pkg/mod/github.com/vmware/vmware-go-kcl-v2@v0.0.0-20220107022458-c862165130e7/clientlibrary/worker/worker.go:127 +0x217
created by github.com/vmware/vmware-go-kcl-v2/clientlibrary/worker.(*Worker).Start
    /go/pkg/mod/github.com/vmware/vmware-go-kcl-v2@v0.0.0-20220107022458-c862165130e7/clientlibrary/worker/worker.go:130 +0x5b
github.com/vmware/vmware-go-kcl-v2/clientlibrary/worker.(*Worker).Start.func1()
    /go/pkg/mod/github.com/vmware/vmware-go-kcl-v2@v0.0.0-20220107022458-c862165130e7/clientlibrary/worker/worker.go:361 +0xb31
github.com/vmware/vmware-go-kcl-v2/clientlibrary/worker.(*Worker).eventLoop(0xc00062c580)
    /go/pkg/mod/github.com/vmware/vmware-go-kcl-v2@v0.0.0-20220107022458-c862165130e7/clientlibrary/worker/worker.go:380 +0x68
github.com/vmware/vmware-go-kcl-v2/clientlibrary/worker.(*Worker).rebalance(0xc00062c580)
    /go/pkg/mod/github.com/vmware/vmware-go-kcl-v2@v0.0.0-20220107022458-c862165130e7/clientlibrary/checkpoint/dynamodb-checkpointer.go:341 +0x3b
github.com/vmware/vmware-go-kcl-v2/clientlibrary/checkpoint.(*DynamoCheckpoint).ListActiveWorkers(0xc000402690, 0x1?)
    /go/pkg/mod/github.com/vmware/vmware-go-kcl-v2@v0.0.0-20220107022458-c862165130e7/clientlibrary/checkpoint/dynamodb-checkpointer.go:444 +0x2f3
github.com/vmware/vmware-go-kcl-v2/clientlibrary/checkpoint.(*DynamoCheckpoint).syncLeases(0xc000402690, 0xc0007292e0?)
goroutine 506 [running]:

[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x15be773]
vmwclabot commented 2 years ago

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

vmwjc commented 1 year ago

Thanks for the contribution. Looks like we merged a duplicate of this fix in 08b7fd9.