-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: move log collector creation logic (#1870)
## Description: Fixes: #1833 The resource leak was being caused by a state where if a failure occurred while creating an enclave (eg. ctrl+C while running `kurtosis enclave add`) at a point where the log collector container was created BEFORE it had been connected to the network AND before the necessary `defer undo`s to clean up the log collector had been queued THEN the network would get cleaned up by the `defer undo` from `CreateNetwork`, but the log collector container would remain. Any attempt to do a `kurtosis clean -a` would fail to clean log collector container because the network(and thus enclave) the container was created for had already been cleaned up. After digging - I realized the log collector was being created in `container-engine-lib` as opposed to in the `engine` Moving the logic to the engine AFTER the enclave is created fixes the issue. If there is an error at ANY point in the creation of the log collector container (even if the log collectors `defer undo` hasn't been queued), the `defer undo` from the `CreateEnclave` call will clean the log collector because it has a label with the `enclaveUUID`. ## Is this change user facing? NO ## References: #1833
- Loading branch information
Showing
4 changed files
with
34 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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