Repository navigation
fix: avoid SnapCtl pipe deadlock - #26
Merged
albertodonato merged 3 commits intoSep 24, 2026
Merged
Conversation
Contributor
Author
|
Here is self-test result - https://pastebin.com/Qwv1ELmE |
zhhuabj
force-pushed
the
pip_overflow_2162621
branch
from
August 24, 2026 08:19
a0778f9 to
7be2d89
Compare
Use Popen.communicate() to consume stdout and stderr while snapctl runs. Calling wait() before reading either pipe can deadlock when snapctl output exceeds the OS pipe buffer: the child blocks while writing, while the parent waits for the child to exit. Preserve stderr for non-zero exits by passing the captured output to SnapCtlError, and add a regression test that writes large data to both streams. LP: #2162621 Closes: openstack-charmers#25 CI-blocked by openstack-charmers#27 Signed-off-by: Zhang Hua <joshua.zhang@canonical.com>
zhhuabj
force-pushed
the
pip_overflow_2162621
branch
from
August 31, 2026 03:12
7be2d89 to
4ca1f1e
Compare
Contributor
Author
|
Hi @albertodonato The CI checks for this PR are currently blocked by #30. Could you pls first merge #30, then I will update this branch from |
This was referenced Sep 29, 2026
Merged
johnramsden
pushed a commit
to canonical/microceph
that referenced
this pull request
Sep 29, 2026
Update snap-helpers from 46803aa9 to 76f8166 to stay in sync with the upstream SnapCtl pipe deadlock fix (openstack-charmers/snap-helpers#26). microceph-orch only uses Snap().paths and does not call SnapCtl, so it is not affected by the deadlock; this is a dependency hygiene bump. Signed-off-by: Zhang Hua <joshua.zhang@canonical.com>
hemanthnakkina
pushed a commit
to canonical/snap-openstack-hypervisor
that referenced
this pull request
Sep 30, 2026
Update snap-helpers from 46803aa9 to 76f8166 to pull in the upstream fix for the SnapCtl.run() pipe deadlock (openstack-charmers/snap-helpers#26). The configure hook calls snap.config.get_options() and snap.services, which can deadlock when snapctl output exceeds the OS pipe buffer. Partial-bug: #2162621 Signed-off-by: Zhang Hua <joshua.zhang@canonical.com>
gboutry
pushed a commit
to canonical/snap-cinder-volume
that referenced
this pull request
Oct 7, 2026
Update snap-helpers from 46803aa9 to 76f8166 to pull in the upstream fix for the SnapCtl.run() pipe deadlock (openstack-charmers/snap-helpers#26). The configure hook calls snap.config.get_options(), which deadlocks when snapctl output exceeds the OS pipe buffer (e.g. a large base64 CA during TLS CA renewal), leaving the hook killed by SIGKILL and the backend config unwritten. Closes-bug: #2162621 Signed-off-by: Zhang Hua <joshua.zhang@canonical.com>
gboutry
pushed a commit
to canonical/snap-openstack-network-agents
that referenced
this pull request
Oct 7, 2026
Update snap-helpers from 46803aa9 to 76f8166 to pull in the upstream fix for the SnapCtl.run() pipe deadlock (openstack-charmers/snap-helpers#26). The configure hook reads snap config via snaphelpers, which can deadlock when snapctl output exceeds the OS pipe buffer. Partial-bug: #2162621 Signed-off-by: Zhang Hua <joshua.zhang@canonical.com>
zhhuabj
added a commit
to zhhuabj/snap-openstack
that referenced
this pull request
Oct 9, 2026
Update snap-helpers from 46803aa9 to 76f8166 to pull in the upstream fix for the SnapCtl.run() pipe deadlock (openstack-charmers/snap-helpers#26). sunbeam's configure hook and checks call snap.config.get_options() and SnapCtl, which can deadlock when snapctl output exceeds the OS pipe buffer. Partial-bug: #2162621 Signed-off-by: Zhang Hua <joshua.zhang@canonical.com>
This was referenced Nov 5, 2026
zhhuabj
added a commit
to zhhuabj/microceph
that referenced
this pull request
Nov 5, 2026
Update snap-helpers from 46803aa9 to 76f8166 to stay in sync with the upstream SnapCtl pipe deadlock fix (openstack-charmers/snap-helpers#26). microceph-orch only uses Snap().paths and does not call SnapCtl, so it is not affected by the deadlock; this is a dependency hygiene bump. Signed-off-by: Zhang Hua <joshua.zhang@canonical.com> (cherry picked from commit 5df62e1)
himax16
pushed a commit
to canonical/snap-openstack
that referenced
this pull request
Nov 5, 2026
Update snap-helpers from 46803aa9 to 76f8166 to pull in the upstream fix for the SnapCtl.run() pipe deadlock (openstack-charmers/snap-helpers#26). sunbeam's configure hook and checks call snap.config.get_options() and SnapCtl, which can deadlock when snapctl output exceeds the OS pipe buffer. Partial-bug: #2162621 Signed-off-by: Zhang Hua <joshua.zhang@canonical.com> (cherry picked from commit 5f72ac1)
johnramsden
pushed a commit
to canonical/microceph
that referenced
this pull request
Nov 5, 2026
Update snap-helpers from 46803aa9 to 76f8166 to stay in sync with the upstream SnapCtl pipe deadlock fix (openstack-charmers/snap-helpers#26). microceph-orch only uses Snap().paths and does not call SnapCtl, so it is not affected by the deadlock; this is a dependency hygiene bump. (cherry picked from commit 5df62e1) Signed-off-by: Zhang Hua <joshua.zhang@canonical.com>
hemanthnakkina
pushed a commit
to canonical/snap-cinder-volume
that referenced
this pull request
Nov 17, 2026
Update snap-helpers from 46803aa9 to 76f8166 to pull in the upstream fix for the SnapCtl.run() pipe deadlock (openstack-charmers/snap-helpers#26). The configure hook calls snap.config.get_options(), which deadlocks when snapctl output exceeds the OS pipe buffer (e.g. a large base64 CA during TLS CA renewal), leaving the hook killed by SIGKILL and the backend config unwritten. Closes-bug: #2162621 Signed-off-by: Zhang Hua <joshua.zhang@canonical.com> (cherry picked from commit 46cbd9e)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use Popen.communicate() to consume stdout and stderr while snapctl runs.
Calling wait() before reading either pipe can deadlock when snapctl output exceeds the OS pipe buffer: the child blocks while writing, while the parent waits for the child to exit.
Preserve stderr for non-zero exits by passing the captured output to SnapCtlError, and add a regression test that writes large data to both streams.
LP: #2162621
Closes: #25