From de6da5706cb6e789149feba2c7af9d7ea65466db Mon Sep 17 00:00:00 2001 From: overmeulen Date: Tue, 24 May 2022 14:45:20 +0200 Subject: [PATCH] Fix LogEmitterProvider.force_flush hanging randomly --- CHANGELOG.md | 3 +++ .../src/opentelemetry/sdk/_logs/export/__init__.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a29ec31f03..965e4802c6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://github.com/open-telemetry/opentelemetry-python/compare/v1.12.0rc1-0.31b0...HEAD) +- Fix LogEmitterProvider.force_flush hanging randomly + ([#2714](https://github.com/open-telemetry/opentelemetry-python/pull/2714)) + ## [1.12.0rc1-0.31b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.12.0rc1-0.31b0) - 2022-05-17 diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/_logs/export/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/_logs/export/__init__.py index 87ac308317d..def39e32c9d 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/_logs/export/__init__.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/_logs/export/__init__.py @@ -178,7 +178,7 @@ def worker(self): flush_request = self._get_and_unset_flush_request() if ( len(self._queue) < self._max_export_batch_size - and self._flush_request is None + and flush_request is None ): self._condition.wait(timeout)