Socket closed unexpectedly after 5 seconds
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- node.js, redis, typescript
- 领域
- backend, networking
调研方向
从 packages/client/lib/client/socket.ts 开始,重点查看 #createSocket,并使用报告中的 Redis 复制和客户端配置复现五秒后断开连接的问题。跟踪初始连接后的超时处理,并确定保持 socket 活跃的受支持行为;当原因以及预期的配置或代码变更已确定,并由回归检查覆盖时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Description
I'm running redis with replication, with the simple client configuration createClient({ url }). After the initial connection is successfully established, the socket is closed after 5 seconds. I guess this is because the socket connectTimeout is by default 5s, and in packages/client/lib/client/socket.ts, it'll close it based on the property.
async #createSocket(): Promise<net.Socket | tls.TLSSocket> {
const socket = this.#socketFactory.create();
let onTimeout;
if (this.#connectTimeout !== undefined) {
onTimeout = () => socket.destroy(new ConnectionTimeoutError());
socket.once('timeout', onTimeout);
socket.setTimeout(this.#connectTimeout);
}
....
return socket;
}
I've already taken a look into other related issues, and I tried setting pingInterval and setting socket connectTimeout to 0, and as expected, the socket is closed regardless. What is the recommended way to keep the socket connection alive?
INFO:
Redis is deployed via Helm (bitnami 20.1.4) into kubernetes cluster, with one master node and 3 replicas.
Node.js Version
20.14.0
Redis Server Version
7.4.0
Node Redis Version
4.7.0
Platform
Linux
Logs
No response
- 主要语言
- TypeScript
- 星标
- 17.6k
- 派生
- 2k
- 平均合并
- 1 天 22 小时
- 30 天内合并 PR
- 62
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
redis/node-redis 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
redis/node-redis#3664 · 1 条评论 ·
维护者通常 1 天内回复
-
After a MOVING handoff, a client never becomes ready again on reconnect可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 3-5 天 新手友好度 68/100
redis/node-redis#3705 ·
维护者通常 1 天内回复
-
accepted Bug
难度 3/5 1-2 天 新手友好度 52/100
redis/node-redis#3674 · 1 条评论 ·
维护者通常 1 天内回复
-
Support Uint8Array values for zero-copy transfer to worker_threads可能已有人在做 @umeshmore45 于 286 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 45/100
redis/node-redis#3106 · 3 条评论 ·
维护者通常 1 天内回复
-
`RedisClientType` type is slow to typecheck (TS performance issue)可能重新可做 @nkaradzhov 于 556 天前认领,目前没有进行中的 PR。 未关闭Bug
redis/node-redis#2975 · 30 条评论 · 27 个 reaction · 已指派 1 人 ·
维护者通常 1 天内回复
相似的 Issue
-
agent/guide documentation help wanted stage/010-actionable
难度 1/5 1 小时以内 新手友好度 82/100
kubestellar/console-marketplace#1101 ·
维护者通常 1 天内回复
-
Java Edition Tests
难度 2/5 1-3 小时 新手友好度 72/100
JSPrismarine/JSPrismarine#4178 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
totec448-spec/chat-on-steroids#2394 ·
维护者通常 1 天内回复
-
github_actions
难度 2/5 1-3 小时 新手友好度 70/100
StellarHyperion/stellarhyperion-backend#499 ·
维护者通常 1 天内回复