running-process 4.2.0__tar.gz → 4.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {running_process-4.2.0 → running_process-4.4.0}/Cargo.lock +2 -2
- {running_process-4.2.0 → running_process-4.4.0}/Cargo.toml +1 -1
- {running_process-4.2.0 → running_process-4.4.0}/PKG-INFO +1 -1
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/Cargo.toml +5 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/bin/daemon.rs +31 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/bin/runpm.rs +118 -9
- running_process-4.4.0/crates/running-process/src/broker/adopt.rs +390 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/backend_sdk/frame_client.rs +23 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/backend_sdk/frame_client_async.rs +11 -0
- running_process-4.4.0/crates/running-process/src/broker/builders.rs +225 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/client.rs +64 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/mod.rs +2 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/protocol/mod.rs +1 -1
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/protocol/registry.rs +15 -1
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/handlers/mod.rs +2 -0
- running_process-4.4.0/crates/running-process/src/daemon/handlers/services.rs +259 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/handlers_tests.rs +5 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/mod.rs +1 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/reaper.rs +8 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/server.rs +25 -0
- running_process-4.4.0/crates/running-process/src/daemon/services.rs +1024 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/lib.rs +93 -4
- running_process-4.4.0/crates/running-process/src/observer/mod.rs +367 -0
- running_process-4.4.0/crates/running-process/src/observer/tests.rs +184 -0
- running_process-4.4.0/crates/running-process/tests/broker/builders.rs +99 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/client.rs +69 -2
- running_process-4.4.0/crates/running-process/tests/broker/into_backend_io.rs +208 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/main.rs +3 -0
- running_process-4.4.0/crates/running-process/tests/broker/toy_three_party.rs +306 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_autostart_test.rs +8 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_runpm_service_stubs.rs +78 -61
- {running_process-4.2.0 → running_process-4.4.0}/pyproject.toml +1 -1
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/__init__.py +1 -1
- running_process-4.2.0/crates/running-process/src/daemon/handlers/services.rs +0 -125
- {running_process-4.2.0 → running_process-4.4.0}/LICENSE +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/README.md +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/README.md +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/build.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/examples/handoff_rollout_evidence.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/proto/broker_v1/broker_v1_admin.proto +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/proto/broker_v1/broker_v1_envelope.proto +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/proto/broker_v1/broker_v1_manifest.proto +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/proto/broker_v1/broker_v1_service_def.proto +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/proto/broker_v1/buf.yaml +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/proto/daemon.proto +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/bin/running-process-broker-v1.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/bin/running-process-cleanup.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/bin/trampoline.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/backend_handle.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/backend_lib/accept_handed_off.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/backend_lib/mod.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/backend_lib/wire.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/backend_lifecycle/identity.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/backend_lifecycle/mod.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/backend_lifecycle/probe.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/backend_lifecycle/probe_async.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/backend_lifecycle/verify_pid.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/backend_sdk/identity_file.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/backend_sdk/mod.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/backend_sdk/mux.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/capabilities.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/doctor.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/fs_health.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/host_identity.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/lifecycle/crash_dump.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/lifecycle/mod.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/lifecycle/names.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/lifecycle/privilege.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/lifecycle/process_tree.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/lifecycle/sid.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/manifest.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/protocol/frame_ext.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/protocol/framing.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/protocol/validate.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/secure_dir.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/admin.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/backend_endpoint_allocator.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/backend_launcher.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/backend_registry.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/broadcast.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/connection.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/control_socket.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/fd_pressure.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/handoff/ack.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/handoff/fallback.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/handoff/handoff_token.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/handoff/latency.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/handoff/mod.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/handoff/orchestrate.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/handoff/orchestrate_unix.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/handoff/pending.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/handoff/unix.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/handoff/windows.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/handoff/wire.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/handoff_serve.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/hello_handler.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/hello_router.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/idle_coord.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/instance.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/metrics.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/mod.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/perf_guard.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/recovery.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/serve.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/service_def_loader.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/spawn_coordinator.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/spawn_wait.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/trace_context.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/broker/server/version_allow_list.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/cleanup/instances.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/cleanup/list.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/cleanup/mod.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/cleanup/prune.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/cleanup/uninstall.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/cleanup/verify_artifacts.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/cleanup/verify_basic.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/client/client.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/client/mod.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/client/paths.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/client/pipe_session.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/client/pty_session.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/client/telemetry.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/console_detect.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/containment.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/attach_stream.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/config.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/emergency_reserve.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/handlers/core.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/handlers/kill.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/handlers/maintenance.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/handlers/pipe_sessions_handlers.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/handlers/process_tree.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/handlers/pty_sessions_handlers.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/handlers/registry_handlers.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/handlers/spawn.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/handlers/telemetry.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/handlers/util.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/idle.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/pipe_attach_stream.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/pipe_sessions.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/platform/mod.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/platform/unix.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/platform/windows.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/pty_sessions.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/registry.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/runtime_gc.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/shadow.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/daemon/telemetry.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/helpers.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/maintenance/mod.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/maintenance/release_handles.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/originator.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/pty/backend.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/pty/conpty_passthrough/child.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/pty/conpty_passthrough/mod.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/pty/conpty_passthrough/pipes.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/pty/conpty_passthrough/proc_thread_attr.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/pty/conpty_passthrough/pseudoconsole.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/pty/mod.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/pty/native_pty_process.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/pty/pty_posix.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/pty/pty_windows.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/pty/terminal_input.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/public_symbols.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/rust_debug.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/spawn.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/spawn_imp_unix.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/spawn_imp_windows.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/systemd_killmode.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/terminal_graphics.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/test_support/conformance.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/test_support/mod.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/tests.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/types.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/unix.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/src/windows.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/admin.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/backend_endpoint_allocator.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/backend_handle_boot_id.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/backend_handle_common.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/backend_handle_dead.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/backend_handle_probe.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/backend_handle_recycled.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/backend_registry.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/backend_sdk.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/backend_sdk_async.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/broadcast_release_handles.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/conformance_kit.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/connection.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/contrib_templates.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/docs_escape_hatch.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/docs_index.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/doctor.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/fd_pressure.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/framing.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/golden_bytes.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_ack_deadline.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_adopted_backend.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_adoption.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_backend_lib.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_capability.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_cross_os_acceptance.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_end_to_end_acceptance.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_fallback_perm_denied.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_latency.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_latency_e2e.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_orchestrate.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_serve_e2e.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_serve_latency.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_token_mismatch.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_transport.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_under_load.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_unix_e2e_orchestrate.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_unix_orchestrate.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_windows_duplicate_handle.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_windows_orchestrate.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/handoff_wire.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/hello_concurrent.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/hello_handler.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/hello_rate_limit.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/hello_router.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/hello_service_unknown.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/hello_skip.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/hello_version_blocked.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/idle_coord.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/instance.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/instance_isolation.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/lifecycle_event_size.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/manifest_atomic.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/manifest_boot_id.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/manifest_corruption.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/manifest_roundtrip.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/metrics_names_frozen.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/names.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/peer_creds_drop.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/perf_guard.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/process_tree_lifecycle.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/proto_field_numbers.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/proto_roundtrip.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/recovery_one_retry.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/serve.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/service_def_loader.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/servicedef_cli.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/socket_common.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/spawn_coordinator.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/spawn_wait.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/trace_propagation.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/verify_pid/linux.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/verify_pid/macos.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/verify_pid/mod.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/broker/verify_pid/windows.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/cleanup/cleanup_list.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/cleanup/cleanup_prune_confirm.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/cleanup/cleanup_prune_dryrun.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/cleanup/cleanup_uninstall.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/cleanup/cleanup_verify_artifacts.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/cleanup/common.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/cleanup/main.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/containment_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_backlog_accumulation_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_cross_process_pty_attach_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_fast_ctrl_c_handoff_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_integration/compiler_wrap_seam_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_integration/env_replace_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_integration/main.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_integration/more_tests.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_integration/stdout_seam_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_non_tty_attach_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_pipe_session_attach_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_pty_session_attach_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_resize_rpc_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_sessions_bulk_ops_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_sessions_log_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_tee_ring_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_termination_outcome_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_tree_kill_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/daemon_tui_repaint_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/fs_adversarial_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/interactive_pty_session_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/maintenance/main.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/maintenance/release_handles_unix.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/maintenance/release_handles_windows.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/originator_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/process_core_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/pty_conhost_job_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/pty_master_public_api_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/security/cross_user_release_handles.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/security/cve_dbus_2014_3639.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/security/cve_dbus_2023_34969.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/security/cve_sccache_2023_1521.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/security/deferred_runtime_surfaces.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/security/dependency_surface.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/security/fuzz_campaign_signoff.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/security/main.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/security/manifest_tamper_detection.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/security/no_network_dependencies.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/security/pipe_name_validation.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/security/pipe_squatting.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/security/security_audit_workflow.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/security/security_fuzz_workflow.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/security/service_name_validation.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/security/unsafe_inventory.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/security/wanted_version_shell_injection.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/security/wanted_version_traversal.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/spawn_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process/tests/terminal_graphics_capabilities_test.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/Cargo.toml +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/containment.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/daemon_client.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/debug_traces.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/helpers.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/idle_detector.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/lib.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/metrics.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/originator.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/pid_tracking.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/priority.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/process.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/process_tree.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/pty_buffer.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/pty_process.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/public_symbols.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/py_native_process.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/registry.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/signal_bool.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/terminal_input.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/tests/control_churn.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/tests/expect_match.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/tests/idle_detector.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/tests/mod.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/tests/parse_command.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/tests/process_tree.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/tests/pty_buffer.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/tests/pty_process.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/tests/registry.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/tests/signal_bool.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/running-process-py/src/tests/terminal_input.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/test-watchdog/Cargo.toml +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/test-watchdog/src/lib.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/crates/test-watchdog/tests/hang_dump.rs +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/assets/example.txt +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/cli.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/command_render.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/compat.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/console_encoding.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/daemon.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/dashboard.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/exit_status.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/expect.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/interrupt_handler.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/launch.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/line_iterator.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/output_formatter.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/priority.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/process_utils.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/processor_cli.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/pty/__init__.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/pty/_command.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/pty/_console_io.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/pty/_errors.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/pty/_idle_helpers.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/pty/_idle_state.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/pty/_interactive.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/pty/_process_helpers.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/pty/_pseudo_terminal.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/pty/_pty_expect.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/pty/_pty_idle_waiter.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/pty/_pty_input_relay.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/pty/_pty_reader.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/pty/_pty_wait_for.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/pty/_terminal_strip.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/pty/_types.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/pty/_wait_input.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/running_process/__init__.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/running_process/_classmethod_api.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/running_process/_core.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/running_process/_helpers.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/running_process/_iter.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/running_process/_subprocess.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/running_process/_types.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/running_process/_wait_methods.py +0 -0
- {running_process-4.2.0 → running_process-4.4.0}/src/running_process/running_process_manager.py +0 -0
|
@@ -1085,7 +1085,7 @@ checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
|
|
|
1085
1085
|
|
|
1086
1086
|
[[package]]
|
|
1087
1087
|
name = "running-process"
|
|
1088
|
-
version = "4.
|
|
1088
|
+
version = "4.4.0"
|
|
1089
1089
|
dependencies = [
|
|
1090
1090
|
"anyhow",
|
|
1091
1091
|
"blake3",
|
|
@@ -1120,7 +1120,7 @@ dependencies = [
|
|
|
1120
1120
|
|
|
1121
1121
|
[[package]]
|
|
1122
1122
|
name = "running-process-py"
|
|
1123
|
-
version = "4.
|
|
1123
|
+
version = "4.4.0"
|
|
1124
1124
|
dependencies = [
|
|
1125
1125
|
"interprocess",
|
|
1126
1126
|
"libc",
|
|
@@ -91,6 +91,11 @@ daemon = [
|
|
|
91
91
|
"dep:rusqlite", "dep:toml",
|
|
92
92
|
]
|
|
93
93
|
originator-scan = [] # used by running-process-py for cwd-tagging
|
|
94
|
+
# #433 R4: opt-in test seam. Gates the `RUNNING_PROCESS_FAKE_BACKEND` backdoor
|
|
95
|
+
# inside `connect_to_backend`. OFF by default and never listed by production
|
|
96
|
+
# consumers, so the backdoor is physically absent from every shipped build.
|
|
97
|
+
# Enabled only by the crate's own test pass (see `ci/test.py`).
|
|
98
|
+
test-seams = ["client"]
|
|
94
99
|
# #415: consumer-consumable conformance test kit
|
|
95
100
|
# (`crate::test_support::conformance`). Off by default; consumers opt in
|
|
96
101
|
# from their `dev-dependencies`.
|
|
@@ -140,6 +140,32 @@ fn parse_duration_secs(value: &str) -> Result<u64, String> {
|
|
|
140
140
|
Ok(n.saturating_mul(unit_secs))
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
+
/// Set the visible process/thread name for the running daemon (#222).
|
|
144
|
+
///
|
|
145
|
+
/// The daemon binary is still `running-process-daemon` (renaming it is out
|
|
146
|
+
/// of Phase 2 scope), but the *visible long-running identity* must be
|
|
147
|
+
/// `runpm-daemon`. On Linux `prctl(PR_SET_NAME)` renames the main thread,
|
|
148
|
+
/// which is what `ps`, `top`, and `/proc/<pid>/comm` report. On other
|
|
149
|
+
/// platforms this is currently a no-op; full argv0 rewriting there is
|
|
150
|
+
/// tracked as follow-up work.
|
|
151
|
+
fn set_daemon_process_name(name: &str) {
|
|
152
|
+
#[cfg(target_os = "linux")]
|
|
153
|
+
{
|
|
154
|
+
// PR_SET_NAME truncates to 15 bytes + NUL; "runpm-daemon" fits.
|
|
155
|
+
if let Ok(cstr) = std::ffi::CString::new(name) {
|
|
156
|
+
// SAFETY: prctl with PR_SET_NAME and a valid NUL-terminated
|
|
157
|
+
// pointer only writes the calling thread's name.
|
|
158
|
+
unsafe {
|
|
159
|
+
libc::prctl(libc::PR_SET_NAME, cstr.as_ptr() as libc::c_ulong, 0, 0, 0);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
#[cfg(not(target_os = "linux"))]
|
|
164
|
+
{
|
|
165
|
+
let _ = name;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
143
169
|
/// Initialize structured logging via `tracing-subscriber`.
|
|
144
170
|
///
|
|
145
171
|
/// Logs go to stderr (standard daemon practice). The level is controlled by
|
|
@@ -165,6 +191,11 @@ fn main() {
|
|
|
165
191
|
socket_path,
|
|
166
192
|
db_path,
|
|
167
193
|
} => {
|
|
194
|
+
// #222: the long-running supervisor identity is `runpm-daemon`,
|
|
195
|
+
// not the launcher binary name. Rename the process so it shows
|
|
196
|
+
// up that way in `ps`/`top` without renaming the binary (which
|
|
197
|
+
// would churn paths, spawn, and packaging across phases).
|
|
198
|
+
set_daemon_process_name("runpm-daemon");
|
|
168
199
|
init_logging();
|
|
169
200
|
// #391: warn at startup when a systemd KillMode would reap
|
|
170
201
|
// spawned children on unit stop. Silent when not under systemd.
|
|
@@ -10,7 +10,7 @@ use clap::{Parser, Subcommand};
|
|
|
10
10
|
|
|
11
11
|
use running_process::client::{connect_or_start, ClientError, DaemonClient};
|
|
12
12
|
use running_process::maintenance::run_release_handles;
|
|
13
|
-
use running_process::proto::daemon::{DaemonResponse, ServiceConfig, StatusCode};
|
|
13
|
+
use running_process::proto::daemon::{DaemonResponse, ServiceConfig, ServiceState, StatusCode};
|
|
14
14
|
|
|
15
15
|
#[derive(Parser)]
|
|
16
16
|
#[command(
|
|
@@ -70,7 +70,11 @@ enum Commands {
|
|
|
70
70
|
},
|
|
71
71
|
/// List all supervised services
|
|
72
72
|
#[command(alias = "ls", alias = "status")]
|
|
73
|
-
List
|
|
73
|
+
List {
|
|
74
|
+
/// Emit JSON instead of a human-readable table
|
|
75
|
+
#[arg(long)]
|
|
76
|
+
json: bool,
|
|
77
|
+
},
|
|
74
78
|
/// Show details about a single service
|
|
75
79
|
#[command(alias = "describe")]
|
|
76
80
|
Show {
|
|
@@ -160,7 +164,7 @@ fn main() -> ExitCode {
|
|
|
160
164
|
Commands::Delete { target } => {
|
|
161
165
|
cmd_simple_target("delete", &target, |c, t| c.service_delete(t))
|
|
162
166
|
}
|
|
163
|
-
Commands::List => cmd_list(),
|
|
167
|
+
Commands::List { json } => cmd_list(json),
|
|
164
168
|
Commands::Show { target } => cmd_show(&target),
|
|
165
169
|
Commands::Logs {
|
|
166
170
|
target,
|
|
@@ -267,19 +271,38 @@ fn cmd_start(
|
|
|
267
271
|
|
|
268
272
|
let mut client = connect()?;
|
|
269
273
|
let resp = client.service_start(config).map_err(client_err)?;
|
|
270
|
-
|
|
274
|
+
ensure_ok("start", &resp)?;
|
|
275
|
+
if let Some(svc) = resp.service_start.and_then(|r| r.service) {
|
|
276
|
+
println!(
|
|
277
|
+
"started '{}' (id={}, pid={}, status={})",
|
|
278
|
+
svc.name, svc.id, svc.pid, svc.status
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
Ok(())
|
|
271
282
|
}
|
|
272
283
|
|
|
273
|
-
fn cmd_list() -> Result<()> {
|
|
284
|
+
fn cmd_list(json: bool) -> Result<()> {
|
|
274
285
|
let mut client = connect()?;
|
|
275
286
|
let resp = client.service_list().map_err(client_err)?;
|
|
276
|
-
|
|
287
|
+
ensure_ok("list", &resp)?;
|
|
288
|
+
let services = resp.service_list.map(|r| r.services).unwrap_or_default();
|
|
289
|
+
if json {
|
|
290
|
+
print_services_json(&services);
|
|
291
|
+
} else {
|
|
292
|
+
print_services_table(&services);
|
|
293
|
+
}
|
|
294
|
+
Ok(())
|
|
277
295
|
}
|
|
278
296
|
|
|
279
297
|
fn cmd_show(target: &str) -> Result<()> {
|
|
280
298
|
let mut client = connect()?;
|
|
281
299
|
let resp = client.service_describe(target).map_err(client_err)?;
|
|
282
|
-
|
|
300
|
+
ensure_ok("show", &resp)?;
|
|
301
|
+
match resp.service_describe.and_then(|r| r.service) {
|
|
302
|
+
Some(svc) => print_service_detail(&svc),
|
|
303
|
+
None => println!("no such service: {target}"),
|
|
304
|
+
}
|
|
305
|
+
Ok(())
|
|
283
306
|
}
|
|
284
307
|
|
|
285
308
|
fn cmd_logs(target: &str, lines: u32, follow: bool) -> Result<()> {
|
|
@@ -301,7 +324,18 @@ where
|
|
|
301
324
|
{
|
|
302
325
|
let mut client = connect()?;
|
|
303
326
|
let resp = call(&mut client, target).map_err(client_err)?;
|
|
304
|
-
|
|
327
|
+
ensure_ok(label, &resp)?;
|
|
328
|
+
let count = match label {
|
|
329
|
+
"stop" => resp.service_stop.as_ref().map(|r| r.stopped_count),
|
|
330
|
+
"restart" => resp.service_restart.as_ref().map(|r| r.restarted_count),
|
|
331
|
+
"delete" => resp.service_delete.as_ref().map(|r| r.deleted_count),
|
|
332
|
+
_ => None,
|
|
333
|
+
};
|
|
334
|
+
match count {
|
|
335
|
+
Some(n) => println!("{label}: {n} service(s)"),
|
|
336
|
+
None => println!("OK: {label}"),
|
|
337
|
+
}
|
|
338
|
+
Ok(())
|
|
305
339
|
}
|
|
306
340
|
|
|
307
341
|
fn cmd_no_arg<F>(label: &str, call: F) -> Result<()>
|
|
@@ -353,8 +387,14 @@ fn client_err(err: ClientError) -> anyhow::Error {
|
|
|
353
387
|
}
|
|
354
388
|
|
|
355
389
|
fn print_status(label: &str, resp: &DaemonResponse) -> Result<()> {
|
|
390
|
+
ensure_ok(label, resp)?;
|
|
391
|
+
println!("OK: {label}");
|
|
392
|
+
Ok(())
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/// Return an error if the daemon responded with a non-OK status code.
|
|
396
|
+
fn ensure_ok(label: &str, resp: &DaemonResponse) -> Result<()> {
|
|
356
397
|
if resp.code == StatusCode::Ok as i32 {
|
|
357
|
-
println!("OK: {label}");
|
|
358
398
|
Ok(())
|
|
359
399
|
} else {
|
|
360
400
|
Err(anyhow!(
|
|
@@ -368,6 +408,75 @@ fn print_status(label: &str, resp: &DaemonResponse) -> Result<()> {
|
|
|
368
408
|
}
|
|
369
409
|
}
|
|
370
410
|
|
|
411
|
+
// ---------------------------------------------------------------------------
|
|
412
|
+
// Service rendering
|
|
413
|
+
// ---------------------------------------------------------------------------
|
|
414
|
+
|
|
415
|
+
fn print_services_table(services: &[ServiceState]) {
|
|
416
|
+
if services.is_empty() {
|
|
417
|
+
println!("no services");
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
println!(
|
|
421
|
+
"{:<4} {:<20} {:<10} {:<8} {:<8} COMMAND",
|
|
422
|
+
"ID", "NAME", "STATUS", "PID", "RESTARTS"
|
|
423
|
+
);
|
|
424
|
+
for s in services {
|
|
425
|
+
let command = s
|
|
426
|
+
.config
|
|
427
|
+
.as_ref()
|
|
428
|
+
.map(|c| c.cmd.join(" "))
|
|
429
|
+
.unwrap_or_default();
|
|
430
|
+
println!(
|
|
431
|
+
"{:<4} {:<20} {:<10} {:<8} {:<8} {}",
|
|
432
|
+
s.id, s.name, s.status, s.pid, s.restart_count, command
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
fn print_service_detail(s: &ServiceState) {
|
|
438
|
+
println!("name: {}", s.name);
|
|
439
|
+
println!("id: {}", s.id);
|
|
440
|
+
println!("status: {}", s.status);
|
|
441
|
+
println!("pid: {}", s.pid);
|
|
442
|
+
println!("restart_count: {}", s.restart_count);
|
|
443
|
+
println!("last_exit: {}", s.last_exit_code);
|
|
444
|
+
if let Some(c) = &s.config {
|
|
445
|
+
println!("command: {}", c.cmd.join(" "));
|
|
446
|
+
if !c.cwd.is_empty() {
|
|
447
|
+
println!("cwd: {}", c.cwd);
|
|
448
|
+
}
|
|
449
|
+
println!("autorestart: {}", c.autorestart);
|
|
450
|
+
println!("max_restarts: {}", c.max_restarts);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
fn print_services_json(services: &[ServiceState]) {
|
|
455
|
+
let values: Vec<serde_json::Value> = services
|
|
456
|
+
.iter()
|
|
457
|
+
.map(|s| {
|
|
458
|
+
serde_json::json!({
|
|
459
|
+
"id": s.id,
|
|
460
|
+
"name": s.name,
|
|
461
|
+
"status": s.status,
|
|
462
|
+
"pid": s.pid,
|
|
463
|
+
"restart_count": s.restart_count,
|
|
464
|
+
"last_started_at": s.last_started_at,
|
|
465
|
+
"last_exited_at": s.last_exited_at,
|
|
466
|
+
"last_exit_code": s.last_exit_code,
|
|
467
|
+
"command": s.config.as_ref().map(|c| c.cmd.clone()).unwrap_or_default(),
|
|
468
|
+
"cwd": s.config.as_ref().map(|c| c.cwd.clone()).unwrap_or_default(),
|
|
469
|
+
"autorestart": s.config.as_ref().map(|c| c.autorestart).unwrap_or(false),
|
|
470
|
+
"max_restarts": s.config.as_ref().map(|c| c.max_restarts).unwrap_or(0),
|
|
471
|
+
})
|
|
472
|
+
})
|
|
473
|
+
.collect();
|
|
474
|
+
match serde_json::to_string_pretty(&values) {
|
|
475
|
+
Ok(s) => println!("{s}"),
|
|
476
|
+
Err(e) => eprintln!("failed to serialize JSON: {e}"),
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
371
480
|
fn parse_env(args: &[String]) -> Result<HashMap<String, String>> {
|
|
372
481
|
let mut out = HashMap::new();
|
|
373
482
|
for entry in args {
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
//! One-call broker adoption: negotiate → dial → ready-to-talk client (#433 R1).
|
|
2
|
+
//!
|
|
3
|
+
//! [`connect_to_backend`] returns a raw
|
|
4
|
+
//! [`BackendConnection`] — a bare
|
|
5
|
+
//! socket the consumer must still wrap in a [`FrameClient`] before it can send
|
|
6
|
+
//! a single request. Every consumer (zccache, soldr, clud, fbuild) repeats the
|
|
7
|
+
//! same three lines: check the disable env, call `connect_to_backend`, wrap the
|
|
8
|
+
//! stream. [`BrokerSession::adopt`] is that recipe, owned once here so the
|
|
9
|
+
//! contract is a single call:
|
|
10
|
+
//!
|
|
11
|
+
//! ```no_run
|
|
12
|
+
//! use running_process::broker::adopt::BrokerSession;
|
|
13
|
+
//! use running_process::broker::client::ConnectBackendRequest;
|
|
14
|
+
//!
|
|
15
|
+
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
16
|
+
//! let request = ConnectBackendRequest::new("broker.sock", "zccache", "1.11.20", "1.11.20");
|
|
17
|
+
//! let mut session = BrokerSession::adopt(request)?;
|
|
18
|
+
//! let reply = session.request(0x7A63, b"ping".to_vec())?;
|
|
19
|
+
//! assert_eq!(reply.payload, b"pong");
|
|
20
|
+
//! # Ok(()) }
|
|
21
|
+
//! ```
|
|
22
|
+
//!
|
|
23
|
+
//! The blocking [`BrokerSession`] is the wire-of-record; the async
|
|
24
|
+
//! [`AsyncBrokerSession`] (feature `client-async`, #433 R3) is a thin
|
|
25
|
+
//! `spawn_blocking` wrapper so tokio daemons get the same one-call adoption
|
|
26
|
+
//! without re-implementing the negotiation against `AsyncRead`/`AsyncWrite`.
|
|
27
|
+
|
|
28
|
+
use crate::broker::backend_sdk::{FrameClient, FrameClientError};
|
|
29
|
+
use crate::broker::client::{
|
|
30
|
+
broker_disabled_by_env, connect_to_backend, BackendConnection, BackendConnectionRoute,
|
|
31
|
+
BrokerClientError, BrokerDisableEnvError, ConnectBackendRequest,
|
|
32
|
+
};
|
|
33
|
+
use crate::broker::protocol::{Frame, Negotiated};
|
|
34
|
+
|
|
35
|
+
/// A negotiated, dialed, and framed broker backend connection.
|
|
36
|
+
///
|
|
37
|
+
/// Produced by [`BrokerSession::adopt`]. Wraps the
|
|
38
|
+
/// [`BackendConnection`] stream in a
|
|
39
|
+
/// [`FrameClient`] so the caller can issue correlated request/response frames
|
|
40
|
+
/// immediately, while still exposing how the connection was reached
|
|
41
|
+
/// ([`route`](Self::route)), the cacheable [`endpoint`](Self::endpoint), and the
|
|
42
|
+
/// broker's [`negotiated`](Self::negotiated) metadata.
|
|
43
|
+
pub struct BrokerSession {
|
|
44
|
+
client: FrameClient,
|
|
45
|
+
route: BackendConnectionRoute,
|
|
46
|
+
endpoint: String,
|
|
47
|
+
negotiated: Option<Negotiated>,
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
impl BrokerSession {
|
|
51
|
+
/// Negotiate through the broker and return a ready-to-talk session.
|
|
52
|
+
///
|
|
53
|
+
/// Honours the canonical escape hatch first: if
|
|
54
|
+
/// `RUNNING_PROCESS_DISABLE=1` is set, this returns
|
|
55
|
+
/// [`AdoptError::BrokerDisabled`] so the consumer falls back to its direct
|
|
56
|
+
/// path instead of silently dialing the broker. An invalid disable value
|
|
57
|
+
/// surfaces as [`AdoptError::DisableEnv`].
|
|
58
|
+
pub fn adopt(request: ConnectBackendRequest<'_>) -> Result<Self, AdoptError> {
|
|
59
|
+
if broker_disabled_by_env()? {
|
|
60
|
+
return Err(AdoptError::BrokerDisabled);
|
|
61
|
+
}
|
|
62
|
+
Ok(Self::from_connection(connect_to_backend(request)?))
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
fn from_connection(connection: BackendConnection) -> Self {
|
|
66
|
+
Self {
|
|
67
|
+
client: FrameClient::from_stream(connection.stream),
|
|
68
|
+
route: connection.route,
|
|
69
|
+
endpoint: connection.endpoint,
|
|
70
|
+
negotiated: connection.negotiated,
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/// How the backend connection was reached.
|
|
75
|
+
pub fn route(&self) -> BackendConnectionRoute {
|
|
76
|
+
self.route
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/// Negotiated backend endpoint, suitable as a Hello-skip cache key.
|
|
80
|
+
pub fn endpoint(&self) -> &str {
|
|
81
|
+
&self.endpoint
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/// Broker negotiation metadata, present when the broker path was used.
|
|
85
|
+
pub fn negotiated(&self) -> Option<&Negotiated> {
|
|
86
|
+
self.negotiated.as_ref()
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/// Send one correlated request and await its response frame.
|
|
90
|
+
pub fn request(
|
|
91
|
+
&mut self,
|
|
92
|
+
payload_protocol: u32,
|
|
93
|
+
payload: Vec<u8>,
|
|
94
|
+
) -> Result<Frame, FrameClientError> {
|
|
95
|
+
self.client.request(payload_protocol, payload)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/// Borrow the underlying frame client for advanced use.
|
|
99
|
+
pub fn client_mut(&mut self) -> &mut FrameClient {
|
|
100
|
+
&mut self.client
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/// Consume the session and return the owned frame client.
|
|
104
|
+
pub fn into_client(self) -> FrameClient {
|
|
105
|
+
self.client
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/// Consume the session and hand back the live negotiated socket as an
|
|
109
|
+
/// owned OS handle (#720).
|
|
110
|
+
///
|
|
111
|
+
/// After adoption has driven the broker handshake to completion, a
|
|
112
|
+
/// consumer that wants to stop speaking the FrameV1 request/response wire
|
|
113
|
+
/// and run its own protocol over the same connection calls this to take
|
|
114
|
+
/// ownership of the raw socket. On Unix the result wraps an
|
|
115
|
+
/// `OwnedFd`; the Windows `OwnedHandle` path is deferred, so this returns
|
|
116
|
+
/// `IntoBackendIoError::WindowsUnsupported` there for now.
|
|
117
|
+
///
|
|
118
|
+
/// Fails with [`IntoBackendIoError::BufferedResidual`] if the frame
|
|
119
|
+
/// reader has buffered response bytes the bare socket would not carry —
|
|
120
|
+
/// which never happens on a freshly adopted session that has issued no
|
|
121
|
+
/// [`request`](Self::request).
|
|
122
|
+
pub fn into_backend_io(self) -> Result<OwnedBackendIo, IntoBackendIoError> {
|
|
123
|
+
let buffered = self.client.buffered_len();
|
|
124
|
+
if buffered != 0 {
|
|
125
|
+
return Err(IntoBackendIoError::BufferedResidual { buffered });
|
|
126
|
+
}
|
|
127
|
+
OwnedBackendIo::from_local_socket_stream(self.client.into_stream())
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/// A live negotiated backend socket handed back as an owned OS handle (#720).
|
|
132
|
+
///
|
|
133
|
+
/// Produced by [`BrokerSession::into_backend_io`] /
|
|
134
|
+
/// `AsyncBrokerSession::into_backend_io`. On Unix it owns an `OwnedFd` the
|
|
135
|
+
/// consumer can wrap in its own transport (e.g.
|
|
136
|
+
/// `std::os::unix::net::UnixStream::from`); the Windows `OwnedHandle` path is
|
|
137
|
+
/// deferred (#720), so the type is never constructed on Windows.
|
|
138
|
+
#[derive(Debug)]
|
|
139
|
+
pub struct OwnedBackendIo {
|
|
140
|
+
// The Windows handle path is deferred (#720). The type still exists so the
|
|
141
|
+
// `into_backend_io` signature is platform-stable, but it carries no handle
|
|
142
|
+
// on Windows and is only ever returned as `Err(WindowsUnsupported)`.
|
|
143
|
+
#[cfg(unix)]
|
|
144
|
+
fd: std::os::fd::OwnedFd,
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
impl OwnedBackendIo {
|
|
148
|
+
#[cfg(unix)]
|
|
149
|
+
fn from_local_socket_stream(
|
|
150
|
+
stream: interprocess::local_socket::Stream,
|
|
151
|
+
) -> Result<Self, IntoBackendIoError> {
|
|
152
|
+
match stream {
|
|
153
|
+
interprocess::local_socket::Stream::UdSocket(uds) => Ok(Self {
|
|
154
|
+
fd: std::os::fd::OwnedFd::from(uds),
|
|
155
|
+
}),
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
#[cfg(windows)]
|
|
160
|
+
fn from_local_socket_stream(
|
|
161
|
+
_stream: interprocess::local_socket::Stream,
|
|
162
|
+
) -> Result<Self, IntoBackendIoError> {
|
|
163
|
+
Err(IntoBackendIoError::WindowsUnsupported)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/// Consume and return the raw owned file descriptor.
|
|
167
|
+
#[cfg(unix)]
|
|
168
|
+
pub fn into_owned_fd(self) -> std::os::fd::OwnedFd {
|
|
169
|
+
self.fd
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
#[cfg(unix)]
|
|
174
|
+
impl std::os::fd::AsFd for OwnedBackendIo {
|
|
175
|
+
fn as_fd(&self) -> std::os::fd::BorrowedFd<'_> {
|
|
176
|
+
self.fd.as_fd()
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/// Errors from [`BrokerSession::into_backend_io`] /
|
|
181
|
+
/// [`AsyncBrokerSession::into_backend_io`].
|
|
182
|
+
#[derive(Debug, thiserror::Error)]
|
|
183
|
+
pub enum IntoBackendIoError {
|
|
184
|
+
/// The frame reader still holds buffered response bytes that the bare
|
|
185
|
+
/// socket would not carry, so the raw handle cannot be taken without
|
|
186
|
+
/// losing them.
|
|
187
|
+
#[error(
|
|
188
|
+
"frame client has {buffered} buffered response byte(s); cannot hand off the raw socket without losing them"
|
|
189
|
+
)]
|
|
190
|
+
BufferedResidual {
|
|
191
|
+
/// Number of bytes buffered by the frame reader.
|
|
192
|
+
buffered: usize,
|
|
193
|
+
},
|
|
194
|
+
/// The async frame client was poisoned by a prior request panic, so its
|
|
195
|
+
/// inner blocking client is gone.
|
|
196
|
+
#[cfg(feature = "client-async")]
|
|
197
|
+
#[error("async frame client was poisoned by a prior request panic")]
|
|
198
|
+
Poisoned,
|
|
199
|
+
/// `into_backend_io()` is not yet supported on Windows; the `OwnedHandle`
|
|
200
|
+
/// path is deferred (#720).
|
|
201
|
+
#[cfg(windows)]
|
|
202
|
+
#[error("into_backend_io() is not yet supported on Windows; the OwnedHandle path is deferred (#720)")]
|
|
203
|
+
WindowsUnsupported,
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/// Errors from [`BrokerSession::adopt`] / [`AsyncBrokerSession::adopt`].
|
|
207
|
+
#[derive(Debug, thiserror::Error)]
|
|
208
|
+
pub enum AdoptError {
|
|
209
|
+
/// `RUNNING_PROCESS_DISABLE=1` is set — the caller should use its direct
|
|
210
|
+
/// (non-broker) path. Not a failure of the broker itself.
|
|
211
|
+
#[error("broker disabled via RUNNING_PROCESS_DISABLE=1; use the direct path")]
|
|
212
|
+
BrokerDisabled,
|
|
213
|
+
/// The disable env var held an invalid value.
|
|
214
|
+
#[error(transparent)]
|
|
215
|
+
DisableEnv(#[from] BrokerDisableEnvError),
|
|
216
|
+
/// Broker negotiation or backend dial failed. Use
|
|
217
|
+
/// [`BrokerClientError::refusal_kind`] to branch on broker refusals.
|
|
218
|
+
#[error(transparent)]
|
|
219
|
+
Connect(#[from] BrokerClientError),
|
|
220
|
+
/// The async adoption worker thread failed to join (panicked or was
|
|
221
|
+
/// cancelled). Only reachable on the `client-async` path.
|
|
222
|
+
#[cfg(feature = "client-async")]
|
|
223
|
+
#[error("async adopt worker failed to join: {0}")]
|
|
224
|
+
AsyncJoin(String),
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/// Owned inputs for [`AsyncBrokerSession::adopt`] (#433 R3).
|
|
228
|
+
///
|
|
229
|
+
/// The blocking [`ConnectBackendRequest`] borrows `&str`, which cannot cross a
|
|
230
|
+
/// `spawn_blocking` boundary. This owned mirror carries the same fields by
|
|
231
|
+
/// value; [`AsyncBrokerSession::adopt`] reconstructs a borrowed
|
|
232
|
+
/// [`ConnectBackendRequest`] from it inside the worker thread.
|
|
233
|
+
#[cfg(feature = "client-async")]
|
|
234
|
+
#[derive(Clone, Debug)]
|
|
235
|
+
pub struct OwnedConnectRequest {
|
|
236
|
+
/// Broker pipe/socket endpoint.
|
|
237
|
+
pub broker_endpoint: String,
|
|
238
|
+
/// Logical service name, such as `zccache`.
|
|
239
|
+
pub service_name: String,
|
|
240
|
+
/// Backend version the caller wants.
|
|
241
|
+
pub wanted_version: String,
|
|
242
|
+
/// Version of the caller's own service binary.
|
|
243
|
+
pub self_version: String,
|
|
244
|
+
/// Previously negotiated backend endpoint, if the caller has one.
|
|
245
|
+
pub cached_backend_endpoint: Option<String>,
|
|
246
|
+
/// Informational client version.
|
|
247
|
+
pub client_version: String,
|
|
248
|
+
/// Client library name for diagnostics.
|
|
249
|
+
pub client_lib_name: String,
|
|
250
|
+
/// Client library version for diagnostics.
|
|
251
|
+
pub client_lib_version: String,
|
|
252
|
+
/// Proposed keepalive interval.
|
|
253
|
+
pub client_keepalive_secs: u64,
|
|
254
|
+
/// Opt in to adopting a handed-off backend connection.
|
|
255
|
+
pub adopt_handed_off_connection: bool,
|
|
256
|
+
/// Deadline for the handoff-ready relay when adoption is enabled.
|
|
257
|
+
pub handoff_ready_timeout: std::time::Duration,
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
#[cfg(feature = "client-async")]
|
|
261
|
+
impl OwnedConnectRequest {
|
|
262
|
+
/// Build an owned request with running-process defaults.
|
|
263
|
+
pub fn new(
|
|
264
|
+
broker_endpoint: impl Into<String>,
|
|
265
|
+
service_name: impl Into<String>,
|
|
266
|
+
wanted_version: impl Into<String>,
|
|
267
|
+
self_version: impl Into<String>,
|
|
268
|
+
) -> Self {
|
|
269
|
+
Self {
|
|
270
|
+
broker_endpoint: broker_endpoint.into(),
|
|
271
|
+
service_name: service_name.into(),
|
|
272
|
+
wanted_version: wanted_version.into(),
|
|
273
|
+
self_version: self_version.into(),
|
|
274
|
+
cached_backend_endpoint: None,
|
|
275
|
+
client_version: String::new(),
|
|
276
|
+
client_lib_name: "running-process".to_string(),
|
|
277
|
+
client_lib_version: env!("CARGO_PKG_VERSION").to_string(),
|
|
278
|
+
client_keepalive_secs: 0,
|
|
279
|
+
adopt_handed_off_connection: false,
|
|
280
|
+
handoff_ready_timeout: crate::broker::client::DEFAULT_HANDOFF_READY_TIMEOUT,
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
fn as_request(&self) -> ConnectBackendRequest<'_> {
|
|
285
|
+
ConnectBackendRequest {
|
|
286
|
+
broker_endpoint: &self.broker_endpoint,
|
|
287
|
+
service_name: &self.service_name,
|
|
288
|
+
wanted_version: &self.wanted_version,
|
|
289
|
+
self_version: &self.self_version,
|
|
290
|
+
cached_backend_endpoint: self.cached_backend_endpoint.as_deref(),
|
|
291
|
+
client_version: &self.client_version,
|
|
292
|
+
client_lib_name: &self.client_lib_name,
|
|
293
|
+
client_lib_version: &self.client_lib_version,
|
|
294
|
+
client_keepalive_secs: self.client_keepalive_secs,
|
|
295
|
+
adopt_handed_off_connection: self.adopt_handed_off_connection,
|
|
296
|
+
handoff_ready_timeout: self.handoff_ready_timeout,
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/// Async counterpart of [`BrokerSession`] for tokio daemons (#433 R3).
|
|
302
|
+
///
|
|
303
|
+
/// Runs the blocking negotiation on `tokio::task::spawn_blocking` and wraps the
|
|
304
|
+
/// resulting [`FrameClient`] in an [`AsyncFrameClient`] so every later request
|
|
305
|
+
/// is `.await`-able without a manual `spawn_blocking` at the call site.
|
|
306
|
+
///
|
|
307
|
+
/// [`AsyncFrameClient`]: crate::broker::backend_sdk::AsyncFrameClient
|
|
308
|
+
#[cfg(feature = "client-async")]
|
|
309
|
+
pub struct AsyncBrokerSession {
|
|
310
|
+
client: crate::broker::backend_sdk::AsyncFrameClient,
|
|
311
|
+
route: BackendConnectionRoute,
|
|
312
|
+
endpoint: String,
|
|
313
|
+
negotiated: Option<Negotiated>,
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
#[cfg(feature = "client-async")]
|
|
317
|
+
impl AsyncBrokerSession {
|
|
318
|
+
/// Negotiate through the broker on a blocking worker and return a
|
|
319
|
+
/// ready-to-talk async session.
|
|
320
|
+
pub async fn adopt(request: OwnedConnectRequest) -> Result<Self, AdoptError> {
|
|
321
|
+
let joined = tokio::task::spawn_blocking(move || {
|
|
322
|
+
BrokerSession::adopt(request.as_request()).map(|session| {
|
|
323
|
+
(
|
|
324
|
+
session.route,
|
|
325
|
+
session.endpoint,
|
|
326
|
+
session.negotiated,
|
|
327
|
+
session.client,
|
|
328
|
+
)
|
|
329
|
+
})
|
|
330
|
+
})
|
|
331
|
+
.await
|
|
332
|
+
.map_err(|err| AdoptError::AsyncJoin(err.to_string()))?;
|
|
333
|
+
let (route, endpoint, negotiated, client) = joined?;
|
|
334
|
+
Ok(Self {
|
|
335
|
+
client: crate::broker::backend_sdk::AsyncFrameClient::from_blocking(client),
|
|
336
|
+
route,
|
|
337
|
+
endpoint,
|
|
338
|
+
negotiated,
|
|
339
|
+
})
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/// How the backend connection was reached.
|
|
343
|
+
pub fn route(&self) -> BackendConnectionRoute {
|
|
344
|
+
self.route
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/// Negotiated backend endpoint, suitable as a Hello-skip cache key.
|
|
348
|
+
pub fn endpoint(&self) -> &str {
|
|
349
|
+
&self.endpoint
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/// Broker negotiation metadata, present when the broker path was used.
|
|
353
|
+
pub fn negotiated(&self) -> Option<&Negotiated> {
|
|
354
|
+
self.negotiated.as_ref()
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/// Send one correlated request and await its response frame.
|
|
358
|
+
pub async fn request(
|
|
359
|
+
&mut self,
|
|
360
|
+
payload_protocol: u32,
|
|
361
|
+
payload: Vec<u8>,
|
|
362
|
+
) -> Result<Frame, FrameClientError> {
|
|
363
|
+
self.client.request(payload_protocol, payload).await
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/// Consume the session and return the owned async frame client.
|
|
367
|
+
pub fn into_client(self) -> crate::broker::backend_sdk::AsyncFrameClient {
|
|
368
|
+
self.client
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/// Consume the session and hand back the live negotiated socket as an
|
|
372
|
+
/// owned OS handle (#720).
|
|
373
|
+
///
|
|
374
|
+
/// Async twin of [`BrokerSession::into_backend_io`]. No `.await` is
|
|
375
|
+
/// needed: the inner blocking client already owns the connected socket, so
|
|
376
|
+
/// taking the raw handle out is a synchronous unwrap. Fails with
|
|
377
|
+
/// [`IntoBackendIoError::Poisoned`] if a prior [`request`](Self::request)
|
|
378
|
+
/// panicked inside `spawn_blocking` and left the client slot empty.
|
|
379
|
+
pub fn into_backend_io(self) -> Result<OwnedBackendIo, IntoBackendIoError> {
|
|
380
|
+
let client = self
|
|
381
|
+
.client
|
|
382
|
+
.into_blocking()
|
|
383
|
+
.ok_or(IntoBackendIoError::Poisoned)?;
|
|
384
|
+
let buffered = client.buffered_len();
|
|
385
|
+
if buffered != 0 {
|
|
386
|
+
return Err(IntoBackendIoError::BufferedResidual { buffered });
|
|
387
|
+
}
|
|
388
|
+
OwnedBackendIo::from_local_socket_stream(client.into_stream())
|
|
389
|
+
}
|
|
390
|
+
}
|