VCS scanner: one slow connection can stall code-subscription scans for hours

未关闭
#2,995 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

已经有一个关联 PR 被合并了。

  • #2996 来自 @neilv-g —— 已合并
  • #2998 来自 @neilv-g —— 已合并

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go, google-cloud

调研方向

Start by finding the VCS scanner worker and archive download code, then trace how it handles HTTP connections, scan timeouts, concurrency, and Pub/Sub message acknowledgment. Implement the three stated limits: a short-lived connection per download, a 3-minute scan timeout, and at most 20 concurrent scans per worker. Done when tests cover these limits and the reported queue stalls are addressed.

由索引模型根据 Issue 内容生成。

描述

bug go

Problem

The Pub/Sub High Latency (prod) alert fired 7 times between Nov 12 and Nov 18 on vcs-scan-tasks-sub-prod. Episodes lasted from 16 minutes to over 6 hours. During each one, repository scans on one worker were delayed by up to an hour, and some scan tasks were silently dropped once they passed the subscription's 1-hour retention.

Why it happens

  • All downloads share one connection. Each scanner worker sends all of its archive downloads over a single shared HTTP/2 connection. Sometimes that connection is slow. New downloads keep arriving before the old ones finish, so the connection never goes idle and is never replaced. It slows every scan on that worker until something resets it.
  • Nothing times out. A stuck download keeps its Pub/Sub message for up to an hour, so the queue backs up and the alert fires.

Fix

  • Give each archive download its own short-lived connection.
  • Time out scans after 3 minutes.
  • Process at most 20 scans at once per worker.

Impact

  • A slow connection affects one download, instead of every scan on a worker for hours.
  • A stuck download is cut off after 3 minutes instead of holding its message for an hour.
主要语言
Go
星标
264
派生
65
平均合并
22 小时 28 分钟
30 天内合并 PR
75

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

GoogleChrome/webstatus.dev 的其他 Issue

查看 GoogleChrome/webstatus.dev 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

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