runprobe

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package runprobe answers, for a process that is not a hub, whether a run of a project is executing (Task 20374).

The hub asks itself the same question before it repairs what a dead run left behind (projectExecuting in pkg/ui), and answers it from four sources. Two are the hub's own memory — the handles of the workloads it dispatched, and the flag it keeps while it streams one — and no other process can see them. The other two are on disk, and this package reads exactly those two, the way the hub reads them:

  • a `cloop run` process executing in the project (pkg/multiui). That is how a run on this host shows, whether a user started it in a terminal or a hub dispatched it to the host executor; and
  • the run's claim in a hub's control plane, judged by the rule hub members judge each other's claims by (hubcluster.RunClaimLive). A clustered hub claims a run before it dispatches it, whatever executor the run goes to, so this is how a run in a container or on a remote device shows.

A claim is recorded in the control plane of the hub that dispatched the run, which lives in the hub's working directory rather than in the project's. The control planes read are therefore the project's own — a hub serving the directory it runs in — and those of the `cloop ui` processes on this host.

What it cannot see it says nothing about: a hub started with ui.cluster.exclusive publishes no claims, and a hub on another machine has no process here. Each recovers its own dead runs. A persisted "running" status is not evidence in either direction; it is precisely what a dead run leaves.

Reading fails closed. A control plane that exists and cannot be read may hold the claim that would have said "live", and acting on a live run is the one mistake a caller cannot take back.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Evidence

type Evidence struct {
	// Live reports that a run is, or may still be, executing the project.
	Live bool
	// Reason says what showed it, as a clause a message can embed — "a `cloop
	// run` process (pid 4242) is executing in /srv/p". Empty when not Live.
	Reason string
}

Evidence is the probe's answer.

func Project

func Project(dir string) Evidence

Project reports whether a run of the project at dir is live.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL