Skip to content
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

deadline option of lease not work #130

Open
zyf0330 opened this issue Jul 27, 2020 · 3 comments
Open

deadline option of lease not work #130

zyf0330 opened this issue Jul 27, 2020 · 3 comments

Comments

@zyf0330
Copy link

zyf0330 commented Jul 27, 2020

I connect to remote etcd and set deadline +4s for lease call, but it cost 1 min to give error 14 UNAVAILABLE: failed to connect to all addresses. Socket keeps SYN_SENT state from ss -tpn.
The option dialTimeout for ETCD3 constructor doesn't work too.

@connor4312
Copy link
Member

I don't hit this; if I write something like

const { Etcd3 } = require('./');

const etcd = new Etcd3({ hosts: ['127.0.0.1:3464'] }); // nothing is on this port

const now = Date.now();
etcd
  .lease(60, { deadline: new Date(now + 1000) })
  .grant()
  .then(() => console.log('grant'))
  .catch(err => console.log('error', err, 'after', Date.now() - now));

I get output like

error GRPCDeadlineExceededError: 4 DEADLINE_EXCEEDED: Deadline exceeded after 1057

@zyf0330
Copy link
Author

zyf0330 commented Sep 19, 2020

Maybe you should try a remote host not localhost. Network detect strategy is different between them.

@zyf0330
Copy link
Author

zyf0330 commented Sep 25, 2020

This just happes when remote host port is at filtered status. And after 30s or 60s it gives error "14 UNAVAILABLE: failed to connect to all addresses".
If remote host port is an opend service which is not etcd service, it gives error "2 UNKNOWN: Stream removed" and elapsed time depends on how long server closes this connection.

So I think the root cause is dialTimeout doesn't work and it should decide this timeout. I doesn't find code implement of option dialTimeout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants