rust-lang / rust-lang/docs.rs

gracefully shut down builder process

Open
#3,251 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-builds E-medium P-medium
Dominant language
Rust
Stars
1.2k
Forks
233
Avg merge
11h 46m
Merged PRs (30d)
59

Description

Right now when you would just restart the builder, we would just

  • stop tracking the background docker run call
  • after restart, pick up the build again from the queue (or another builder does)
  • and start from scratch.

This means some time after a "simple" restart, we still have the old build running and consuming resources (cpu, memory, disk).

The current workaround is

  1. lock the queue
  2. wait until all in-progress builds are finished
  3. restart the server processes
  4. unlock the queue

What woud actually be the best option is:

  • extend https://github.com/rust-lang/rustwide so it supports cancelling an in-progress build (probably just SIGTERM or SIGKILL the docker run process.
  • change the builder so it can listen to the signals,
  • update the in-progress records in the builds table
  • kill the in-progress builds on shutdown

See also https://github.com/rust-lang/docs.rs/pull/3250

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by reviewing rustwide's support for cancelling an in-progress build and the builder's signal-handling path. Trace how in-progress records are represented in the builds table and how shutdown currently works. Done means shutdown terminates active docker run builds and updates their records so a restart does not leave orphaned builds consuming resources.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, rust
Domain
backend, build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.