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

Open
#2,995 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #2996 by @neilv-g — merged
  • #2998 by @neilv-g — merged

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go, google-cloud

Research direction

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.

Written by the indexing model from the issue text.

Description

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.
Dominant language
Go
Stars
264
Forks
65
Avg merge
22h 28m
Merged PRs (30d)
75

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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.

More from GoogleChrome/webstatus.dev

All issues in GoogleChrome/webstatus.dev

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.