Container creation locks Emacs #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Running
degudev-create-containersblocks Emacs for the entire durationof container setup (potentially several minutes). The user cannot
interact with Emacs until both containers are fully provisioned.
Root cause
degudev--setup-containercalls synchronousincus.elfunctionssequentially:
incus-launch— creates the container (slow)incus-exec/incus-exec-as-user— runs shell commands inside thecontainer (multiple calls: user creation, package installation, git
config, Claude settings, custom setup commands)
incus-add-device— mounts disk devices (multiple calls)(sleep-for 5)— explicit sleep after launchAll of these use
incus--run, which callsshell-command-to-stringandblocks until completion. Two full container setups run back-to-back
(reviewer then developer), compounding the problem.
Current state of incus.el
As of 2026-04-12,
incus.elnow providesincus--run-async, and theinteractive commands (
incus-create,incus-start,incus-stop,incus-delete) use it. However, the low-level API functions thatdegudev.eldepends on are still synchronous:incus-execincus-exec-as-userincus-add-deviceincus-launchincus-device-exists-pincus-container-exists-pProposed approach
There are two layers to address:
1. incus.el — async variants of low-level API functions
Add async versions of the low-level functions (e.g.,
incus-launch-async,incus-exec-async,incus-add-device-async) thataccept a callback, following the pattern already established by
incus--run-async.Alternatively, the existing functions could be made async with an
optional callback parameter (sync when omitted, async when provided).
2. degudev.el — async orchestration of container setup
degudev--setup-containermust be rewritten to chain async operationsusing callbacks or a sequential-async pattern. Key considerations:
container before executing commands inside it).
be set up in parallel.
sleep-for 5after launch should be replaced with a properreadiness check or an async delay.
messageas each stepcompletes.
Where to fix
Both packages need changes:
incus.el— provide async low-level APIdegudev.el— use the async API and orchestrate steps with callbacksReproduction