Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libct/nsenter: fix logging race in nsexec
As reported in issue 3119, there is a race in nsexec logging that can lead to garbled json received by log forwarder, which complains about it with a "failed to decode" error. This happens because dprintf (used since the very beginning of nsexec logging introduced in commit ba3cabf) relies on multiple write(2) calls, and with additional logging added by 64bb59f a race is possible between runc init parent and its children. The fix is to prepare a string and write it using a single call to write(2). [v2: NULLify json on error from asprintf] Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
- Loading branch information