Skip to content

Explain why start did nothing when a process is below its quantity - #41

Open
facundofarias wants to merge 1 commit into
adamcooke:masterfrom
deployhq:start-reports-under-quota
Open

facundofarias wants to merge 1 commit into
adamcooke:masterfrom
deployhq:start-reports-under-quota

Conversation

@facundofarias

Copy link
Copy Markdown

Problem

Supervisor#start_processes skips any process type that already has running instances, so a type running 23 of a configured 25 is skipped entirely:

$ procodile start -p worker
No processes to start.

$ procodile status
 * worker only has 23 instances (should have 25)

Two commands contradicting each other, with nothing pointing at check_concurrency as the one that actually tops the type up.

Change

Behaviour and the existing message are unchanged. When the supervisor is reporting an incorrect quantity for a type the user asked to start, the reason and remedy follow it:

No processes to start.
worker is running below the configured quantity.
Run `procodile check_concurrency` to start the missing process(es).

Notes

  • The quantity lookup is a status call from the CLI — no change to the control protocol or to start_processes.
  • It is advisory only, and wrapped so that a failure to read status cannot turn a successful no-op into an error.
  • Requested instance names (worker.1) are reduced to their process type before matching.

Specs in spec/specs/cli_spec.rb cover the filtering logic. Full suite green (40 examples).

Supervisor#start_processes skips any process type that already has running
instances:

    next if @processes[process] && !@processes[process].empty?

so a type running 23 of a configured 25 is skipped entirely and `procodile
start <type>` prints:

    No processes to start.

while `procodile status` simultaneously reports:

    * worker only has 23 instances (should have 25)

Two commands contradicting each other, with no hint that `check_concurrency`
is the one that tops the type up.

Keep the existing behaviour and message, but follow it with the reason and
the remedy when the supervisor is reporting an incorrect quantity for a type
the user asked to start.

The quantity check is advisory: it is wrapped so a failure to read status
cannot turn a successful no-op into an error.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P89F451YDRDBj5br14i3GD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant