断网状态下,stream读取数据超时会连续报错两次,导致keepalive方法会连续调用两次,其中一个setInterval就永远不会被clear
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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