kubernetes-client / kubernetes-client/javascript

cancel watches

未关闭
#2,860 3 条评论 1 个 reaction 已指派 2 人 已被 @brendandburns 认领 在 GitHub 查看
主要语言
TypeScript
星标
2.3k
派生
568
平均合并
17 小时 57 分钟
30 天内合并 PR
41

描述

With version `1.4.0` `watch.watch` returns a `Promise` that is the `AbortController`. When using a `resourceVersion=X` param (only retrieve updates from the current state) the `Promise` appears to only resolve *after* the first update has been received.

In my case I am trying to do some crude dead peer/watch detection and this pattern has some challenges. Let's say I have a 10m inactivity window where I consider the peer/watch dead if no messages have been received in that window. If nothing comes through in the 10m window I still have an unresolved `Promise` and therefore cannot call `AbortController.abort()` to abort the request. If I can't abort the request and just recreate a new watch I possibly end up with multiple active watches.

Any thoughts or other ideas about how to sanely check for dead peer/watches and/or how to deal with the `AbortController` not being available until the first message has been received?

Thanks!

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。