Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logger: Create only one Context per process for mobile #38149

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

fix test

29f75fd
Select commit
Loading
Failed to load commit list.
Open

logger: Create only one Context per process for mobile #38149

fix test
29f75fd
Select commit
Loading
Failed to load commit list.
CI (Envoy) / Envoy/macOS succeeded Feb 3, 2025 in 6m 2s

Envoy/macOS (success)

Check has finished

Details

Check run finished (success ✔️)

The check run can be viewed here:

Envoy/macOS (pr/38149/main@29f75fd)

Check started by

Request (pr/38149/main@29f75fd)

abeyad @abeyad 29f75fd #38149 merge main@4683dbc

logger: Create only one Context per process for mobile

The Logger::Context operates as a stack. When a new one is created, it becomes the active Context. When it gets destroyed, the destructor pops the previous Context as the currently active one.

This can lead to lifetime bugs in Envoy Mobile, if multiple engines are created and the destruction of those engines lead to indeterminate destruction of the Logger::Context objects.

In this commit, the behavior is changed so that the Logger::Context initialization is done by the external caller, not inside StrippedMainBase as previously done. This allows the caller, in this case, Envoy Mobile, to ensure only one Logger::Context is ever created, circumventing any potential issues on Context destruction with popping the previously saved context.

Environment

Request variables

Key Value
ref c6b0b96
sha 29f75fd
pr 38149
base-sha 4683dbc
actor abeyad @abeyad
message logger: Create only one Context per process for mobile...
started 1738614920.731929
target-branch main
trusted false
Build image

Container image/s (as used in this CI run)

Key Value
default envoyproxy/envoy-build-ubuntu:d2be0c198feda0c607fa33209da01bf737ef373f
mobile envoyproxy/envoy-build-ubuntu:mobile-d2be0c198feda0c607fa33209da01bf737ef373f
Version

Envoy version (as used in this CI run)

Key Value
major 1
minor 34
patch 0
dev true