-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
etcd clientv3 doesn't renew the auth token #1828
Comments
问题好像出现在go-zero内部定时轮询ETCD时,token过期了服务器上不存在token了,但还是使用之前的token,从而导致服务瘫痪 |
The problem seems to occur when go-zero polls ETCD regularly, the token expires and there is no token on the server, but the previous token is still used, resulting in service paralysis |
I'm wondering if your code has anything related to go-zero? |
It's etcd bug, please see issues |
This issue is stale because it has been open for 30 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
The etcd clientv3 doesn't renew the auth token when it expires, it just fails with invalid auth token. It happens with both simple and jwt token types.
Steps to reproduce:
Start etcd with etcd --auth-token simple --auth-token-ttl 5
Enable authentication
etcdctl user add root
etcdctl user grant-role root root
etcdctl auth enable
Verify that it works
etcdctl --user root:root put test test
etcdctl --user root:root get test
Run the following Go program
output:
As you can see, the first client.Get succeeded in fetching the test key, but the second one fails with invalid auth token.
Am I missing something simple here?
EDIT: If you make 10 requests while sleeping for 1 second in-between, the error does not show up.
The text was updated successfully, but these errors were encountered: