Add logging to track down why Calamari hangs when running clean packages - #2156
Open
LukeButters wants to merge 2 commits into
Open
LukeButters wants to merge 2 commits into
LukeButters wants to merge 2 commits into
Conversation
APErebus
approved these changes
Sep 14, 2026
There was a problem hiding this comment.
🟡 Changes recommended
Two unresolved diagnostic logging issues remain in SystemSemaphoreManager.cs.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds verbose diagnostics to investigate Calamari hangs during package cleanup.
Changes:
- Logs package-retention progress.
- Logs semaphore access-control operations.
- Logs script-isolation lock creation inputs.
File summaries
| File | Summary | Review notes |
|---|---|---|
source/Calamari/Deployment/PackageRetention/Model/PackageJournal.cs |
Adds retention progress logging. | — |
source/Calamari.Common/Features/Processes/Semaphores/SystemSemaphoreManager.cs |
Adds semaphore ACL diagnostics. | Two nit findings: prevent success logging after ACL failure (3 votes), and align the logged semaphore name with the actual object (1 vote). |
source/Calamari.Common/Features/Processes/ScriptIsolation/LockOptionsResolver.cs |
Logs lock creation inputs. | — |
Review details
Suppressed comments (1)
source/Calamari.Common/Features/Processes/Semaphores/SystemSemaphoreManager.cs:114
- The added message identifies the semaphore as
Global\\{name}, butAcquireSemaphoreconstructs it with the unqualifiednamebefore passingglobalNamehere. This makes the new diagnostic refer to a different Windows namespace than the object being configured; either log the actual object name or change the construction consistently with the intended scope.
log.Verbose($"Setting full control for all users on semaphore '{name}'");
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| log.Verbose($"Failed to set access controls on semaphore '{name}': {e.PrettyPrint()}"); | ||
| } | ||
|
|
||
| log.Verbose($"Set full control for all users on semaphore '{name}'"); |
LukeButters
enabled auto-merge
September 14, 2026 06:04
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.
Add logging to find out why Calamari hangs:
Fixes: LEV-1887
Fixes: LEV-829