etcd icon indicating copy to clipboard operation
etcd copied to clipboard

receipt: dequeue not returning watch err

Open wxsms opened this issue 1 year ago • 8 comments

the error from watch is not returned, if the client token expired, the ev return by watch will be nil, therefore the Deque method will panic in such case.

Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.

wxsms avatar Jan 04 '24 12:01 wxsms

Hi @wxsms. Thanks for your PR.

I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Jan 04 '24 12:01 k8s-ci-robot

Can you add a test?

serathius avatar Jan 05 '24 08:01 serathius

Hi there, Thanks for reply, I just added a test to simulate an error during watch by shutting down a cluster, since I'm very new to etcd, not sure if I make it correctly. The main propose of this PR is to make sure watch return a non-nil value or error. The testcase will failed as followed if queue code stay untouched:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xad0bb6]

goroutine 169 [running]:
go.etcd.io/etcd/client/v3/experimental/recipes.(*Queue).Dequeue(0xc00045b290)
        /workspaces/etcd/client/v3/experimental/recipes/queue.go:70 +0x1f6
go.etcd.io/etcd/tests/v3/integration/clientv3/experimental/recipes_test.TestQueueWatchError.func1()
        /workspaces/etcd/tests/integration/clientv3/experimental/recipes/v3_queue_test.go:92 +0x25
created by go.etcd.io/etcd/tests/v3/integration/clientv3/experimental/recipes_test.TestQueueWatchError in goroutine 64
        /workspaces/etcd/tests/integration/clientv3/experimental/recipes/v3_queue_test.go:91 +0x153
FAIL    go.etcd.io/etcd/tests/v3/integration/clientv3/experimental/recipes      1.107s

wxsms avatar Jan 10 '24 06:01 wxsms

Sry but I have no idea why integration/clientv3 TestMaintenanceSnapshotCancel failing, every thing's fine while running tests inside my codespace, including this one. Can anyone help to take a look?

image

wxsms avatar Jan 15 '24 02:01 wxsms

/retest

jmhbnz avatar Feb 21 '24 01:02 jmhbnz

/retest

serathius avatar Feb 21 '24 08:02 serathius

cc @moficodes

siyuanfoundation avatar Apr 25 '24 18:04 siyuanfoundation

/retest

serathius avatar Apr 26 '24 07:04 serathius