cpp_client_telemetry icon indicating copy to clipboard operation
cpp_client_telemetry copied to clipboard

Remove global C++ objects

Open tkukielk opened this issue 3 years ago • 2 comments
trafficstars

Telemetry API should be accessible before global C++ objects (with non-trivial constructors) are constructed. This may happen when executing code in +load in Obj-C runtime, which starts before C++ globals construction, or in case of global C++ constructors race, where the order of constructors is not guaranteed in some runtimes. The replacements for such problematic globals are accessor functions with local static objects created on demand.

tkukielk avatar Sep 13 '22 00:09 tkukielk

CLA assistant check
All CLA requirements met.

ghost avatar Sep 13 '22 00:09 ghost

Changes looked good to me initially, but I didn't think about the backward compatibility aspects. In existing setup, there is nothing stopping the applications to build their own logic around these global statics, and all these applications need to change with this PR.

While I do see this change in the right direction, we need to carefully plan for any such breaking change as part of v4 design (which is tentatively planned for next Azure semester).

@mkoscumb if you have any further comments here.

lalitb avatar Sep 13 '22 17:09 lalitb