cpp_client_telemetry icon indicating copy to clipboard operation
cpp_client_telemetry copied to clipboard

FlushAndTeardown is insufficient to save data to disk

Open n8ta-msft opened this issue 1 year ago • 0 comments

Describe your environment. Version 3.7.62.1 c# wrapper, highly likely to repro from c++

Steps to reproduce.

            var logger = LogManager.Initialize("your token");
            var config = new LogConfiguration()
            {
                OfflineStorage = "C:\\path\\",
                MaxTeardownUploadTimeInSec = 0,
            };
            LogManager.PauseTransmission();
            for (var i = 0; i < 1000; i++)
            {
                var ev = new EventProperties("test");
                logger.LogEvent(ev);
            }
            LogManager.FlushAndTeardown();

What is the expected behavior? All 1000 events are persisted to disk

What is the actual behavior? <1000 seen

Additional context. Adding a Flush before FlushAndTeardown resolves the problem but is clearly a hack. Discussed here: https://github.com/microsoft/cpp_client_telemetry/pull/1186

@lalitb @mkoscumb

n8ta-msft avatar Aug 01 '23 22:08 n8ta-msft