← Back to issue list

Race when reusing an instance mid-shutdown

View original Github issue

Metadata

Project
craft-providers
Number
#1037
Type
issue
State
open
Author
jonathan-conder
Labels
—
Created
Updated
Closed
—

Current evaluation

Race condition when reusing an instance mid-shutdown causes cancellation request to be silently dropped, resulting in instance stopping unexpectedly.

Suggested action: needs triage

Reason: This is a new, unlabelled issue with no maintainer response or comments. The bug is clearly described with specific systemd-logind error messages and a CI failure link (https://github.com/canonical/uv-sdk/actions/runs/40453360288/job/122020943457), but requires maintainer assessment to prioritize and assign.

Evaluated by: mr-cal-bot

Impact: 65 Quick Win: 15 Complexity: 65 Confidence: 75 Actionability: 65

Issue body

### Bug Description If the guest is mid-transaction when `shutdown -c` runs, the cancellation request is silently dropped: ``` Failed to set wall message, ignoring: Transaction for systemd-logind.service/start is destructive (systemd-tmpfiles-setup-dev-early.service has 'stop' job queued, but 'start' is included in transaction). Failed to talk to logind, shutdown hasn't been cancelled: ... ``` Eventually the instance stops, and every subsequent command fails: ``` Failed to read /etc/os-release. ... * Command exit code: 1 * Command standard error output: 'Error: Instance is not running\n' ``` Observed here: https://github.com/canonical/uv-sdk/actions/runs/40453360288/job/122020943457 ### To Reproduce It's not going to be reliable, but the linked job ran `sdkcraft pack` followed by `sdkcraft test`; it probably suffices to run `*craft pack` twice with the right timing. Or you could try running something like `lxc stop <INSTANCE> & *craft pack`. ### part yaml ```shell ``` ### Relevant log output ```shell Starting sdkcraft, version 0.0.post1.dev1+ga7b62e681 Logging execution to '/home/ubuntu/.local/state/sdkcraft/log/sdkcraft-20261027-053733.371705.log' Launching managed ubuntu 26.04 instance... Starting instance Starting sdkcraft, version 0.0.post1.dev1+ga7b62e681 Logging execution to '/tmp/sdkcraft.log' Initializing lifecycle Rust is installed on the system, skipping rustup Installing build-packages Skipping pull for uv (already ran) Skipping build for uv (already ran) Skipping stage for uv (already ran) Skipping prime for uv (already ran) Skipping pack (already ran) Already packed: uv_amd64_ubuntu@26.04.sdk Launching managed ubuntu 24.04 instance... Failed to set wall message, ignoring: Transaction for systemd-logind.service/start is destructive (systemd-tmpfiles-setup-dev-early.service has 'stop' job queued, but 'start' is included in transaction). Failed to talk to logind, shutdown hasn't been cancelled: Transaction for systemd-logind.service/start is destructive (systemd-binfmt.service has 'stop' job queued, but 'start' is included in transaction). Failed to read /etc/os-release. * Command that failed: 'lxc --project sdkcraft exec local:sdkcraft-uv-ubuntu-2404-amd64-774177-f08a4fc804f7880001a9 -- env CRAFT_MANAGED_MODE=1 SDKCRAFT_DEBUG=False SDKCRAFT_LXD_REMOTE=local SDKCRAFT_LAUNCHPAD_INSTANCE=production SDKCRAFT_IDLE_MINS=10 DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_PRIORITY=critical cat /etc/os-release' * Command exit code: 1 * Command standard error output: 'Error: Instance is not running\n' Full execution log: '/home/ubuntu/.local/state/sdkcraft/log/sdkcraft-20261027-053733.371705.log' Error: Process completed with exit code 1. ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b
Impact: 65
Quick Win: 15
Complexity: 65
Confidence: 75
Actionability: 65
needs triage Race condition when reusing an instance mid-shutdown causes cancellation request to be silently dropped, resulting in instance stopping unexpectedly.

Update history

Date Change
updated
created

Related issues

No related issues found above the similarity threshold.