etcd-io / jetcd

etcd java client
Apache License 2.0
1.1k stars 315 forks source link

client watch failed when receive response **watch id is -1, and cancel reason is "etcdserver: invalid auth token" #1192

Open lebronparker opened 1 year ago

lebronparker commented 1 year ago

Versions

Describe the bug when client watch failed, then server response watch id is -1, and cancel reason is "etcdserver: invalid auth token", but implenment of code watchImp:262 will onError "etcd server failed to create watch id", and return it directly. it will cause watch problem, client watcher will not receive any message from etcd server. image

To Reproduce

  1. start a etcd cluster first with user、 password, auth-token configuration is default "simple"
  2. start a register client and watcher client test it
  3. kill all etcd node of etcd cluster
  4. restart etcd cluser, then watcher client will receive invalid token exception

Expected behavior

  1. jetcd client should resume watchImp, and add token valid error check when watch exception
  2. if any other exception that jetcd should deal with

Additional context

  1. why jetcd client use cancel reason to check exception, if cause reason is changed, it will be unuseful image
lburgazzoli commented 1 year ago

it should have been fixed in 0.7.6, can you try it out ?

lebronparker commented 1 year ago

it should have been fixed in 0.7.6, can you try it out ?

ok, i will try it later, thank you.

lburgazzoli commented 1 year ago

@lebronparker any update ?