Repository navigation
fix(start): make retry-loop containers self-removing - #243
Conversation
Verification helpers run inside retry_with_fixed_delay closures that reuse a fixed docker --name. Without --rm the first failed attempt leaves a stopped container and every retry fails immediately with 'container name is already in use'. Add ephemeral_run_args() (run --rm --name <n> -u <u> --network host) and use it for the MockUSDFC, PDP registry verification, and endorsement read-only checks. Endorsement receipt/provider-list container names now include the run id so a leftover container from an interrupted run cannot block a new one.
|
@OzzyHelper rebase, fix the lint |
|
❌ Permission denied. Only users with write access can trigger bot commands. |
|
github-mgmt run has failed, so it didn't add OzzyHelper to the repo |
|
I'll take a quick look @Kubuxu |
|
@Kubuxu : with quick agent help, we couldn't figure out why FilOzone/github-mgmt#75 didn't apply. I manually added for now... |
|
@OzzyHelper rebase, fix the lint |
Rebase with requested adjustmentsBranch Changes applied
StatsActions performed
CI statusCI will be checked asynchronously. Automated by Kōan |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the read-only container cleanup and run-scoped endorsement naming changes.
No open issues 🎉
What changed in this PR
This PR prevents stopped read-only Docker containers from blocking startup retries in foc-devnet and makes endorsement check container names unique per run.
Changes:
- Adds a shared Docker argument helper with automatic removal and a unit test for its contract.
- Applies the helper to six read-only startup checks, leaving transaction containers available for log inspection.
- Passes the run ID into endorsement receipt and provider-list checks.
| File | Description |
|---|---|
src/docker/shell.rs |
Adds ephemeral_run_args and tests automatic removal, naming, and host networking. |
src/docker/mod.rs |
Re-exports the new helper. |
src/commands/start/usdfc_deploy/verification.rs |
Makes MockUSDFC verification containers self-removing. |
src/commands/start/pdp_service_provider/registration.rs |
Makes provider count, ID, and approval query containers self-removing. |
src/commands/start/endorsement/operations.rs |
Adds automatic removal and run-scoped names to receipt and provider-list checks. |
src/commands/start/endorsement/endorsement_step.rs |
Supplies the current run ID to the provider-list query. |
Review effort: Balanced
What
Make the read-only Docker containers used inside startup retry loops remove
themselves on exit, and scope the remaining fixed endorsement container names
by run id.
Why
retry_with_fixed_delayclosures reused a fixeddocker run --namewithout--rm. As soon as an attempt failed, its stopped container survived and everysubsequent retry failed instantly with
container name is already in use—turning a transient RPC hiccup into a permanent failure. The MockUSDFC
verification, PDP registry queries, and endorsement receipt/provider-list
checks were all affected. Two endorsement names (
foc-verify-endorse-<id>,foc-get-provider-ids) did not include the run id at all, so a container leftbehind by an interrupted run could block the next network start.
How
docker::shell::ephemeral_run_args(name, user)— the commonrun --rm --name <n> -u <u> --network hostprefix — so the retry-safeinvariant lives in one place instead of being re-derived per call site.
run_id.Transaction containers (registration, endorsement send) intentionally keep
their containers for post-mortem log inspection and are unchanged.
Testing
cargo clippy --lib -- -D warnings— clean.cargo test --lib— 52 passed; 2 failures are the pre-existingDocker-dependent status tests (
test_print_running_status,test_print_uptime) that fail in this sandbox without a Docker CLI.test_ephemeral_run_args_remove_container_on_exitpins the--rm/--name/--network hostcontract.Quality Report
Changes: 6 files changed, 79 insertions(+), 70 deletions(-)
Code scan: clean
Tests: skipped
Branch hygiene: 1 issue(s)