microsoft / microsoft/etcd3

dialTimeout not working

Open
#137 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
546
Forks
76
Avg merge
22h 46m
Merged PRs (30d)
13

Description

I have this

const etcd = new Etcd3({
                    credentials: { rootCertificate: fs.readFileSync(etcdCertFile) },
                    dialTimeout: 5000,
                    hosts: "hostname:port"
                })
const cfg = await etcd.get("/cfg").string()

I would expect it to throw an exception after 5 seconds if the host is not reachable.

Instead it seems there are 3 connections tries, lasting about 21 seconds each, after which a GRPCUnavailableError occurs. The dialTimeout can be changed, but it doesn't matter.

Is there another way to configure the connection timeout?

BTW, afaict, the example of "defaultCallOptions" for 10 second deadline is wrong - it shouldn't just return a number, but something like { deadline: ... }.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start at the Etcd3 constructor and the defaultCallOptions configuration, then reproduce the unreachable-host case with dialTimeout set; done means the timeout behavior is corrected or the supported connection-timeout configuration and example are clearly established.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, node.js, typescript
Domain
api, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.