-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libc/logs: wait for init/nsenter logs
Adding more nsenter debug logging revealed a bug: some logs were lost, resulting in random failures of debug.bats tests (usually the ones that write to a file). The bug happens because the main thread does not wait for the ForwardLogs goroutine to do its work, and it is reproducible with a short-lived container and a (relatively) slow operation of writing logs to a file. Obviously, a way to fix this is to make the main thread wait for the ForwardLogs goroutine. This works only if we explicitly close the writing end of a log pipe, so this closing had to be added. Funny, there is already a unit test for this :^) [v2: amend the libct/integration/init_test.go with the same logic as in init.go so it could close logpipe, except setting loglevel is optional] Signed-off-by: Kir Kolyshkin <[email protected]>
- Loading branch information
Showing
8 changed files
with
57 additions
and
16 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
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