microsoft / microsoft/etcd3

断网状态下,stream读取数据超时会连续报错两次,导致keepalive方法会连续调用两次,其中一个setInterval就永远不会被clear

Open
#196 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

断网状态下,stream会连续收到两次error事件,内容为“14 UNAVAILABLE: read ETIMEDOUT”,这个错误会触发连续两次handleKeepaliveError方法的调用,而handleKeepaliveError中对keepalive()的调用使用了setTimeout,所以就会连续两次调用keepalive()方法,导致teardown变量的值被最后一次调用覆盖,那么第一次调用中生成的setInterval就永远不会被清除,稳定复现,
复现操作是创建成功租约后,把网线断开观察即可

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

Start by locating the stream error handling and the handleKeepaliveError and keepalive methods described in the issue. Reproduce the problem by creating a lease and disconnecting the network, then trace both error-triggered timers. Done means repeated timeout errors do not leave any setInterval running after teardown.

Written by the indexing model from the issue text.

Assessment

Tech stack
grpc, node.js, typescript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.