From d618e30480e4491a54d30bb281a0de765fde317d Mon Sep 17 00:00:00 2001 From: alrex Date: Sun, 19 Sep 2021 17:07:27 -0700 Subject: [PATCH] use timeout in force_flush (#2118) * use timeout in force_flush * fix lint * Update opentelemetry-sdk/src/opentelemetry/sdk/logs/export/__init__.py Co-authored-by: Srikanth Chekuri * fix lint Co-authored-by: Srikanth Chekuri --- opentelemetry-sdk/src/opentelemetry/sdk/logs/export/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/logs/export/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/logs/export/__init__.py index 167e487102d..31dff4fa099 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/logs/export/__init__.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/logs/export/__init__.py @@ -266,7 +266,7 @@ def force_flush(self, timeout_millis: Optional[int] = None) -> bool: flush_request = self._get_or_create_flush_request() self._condition.notify_all() - ret = flush_request.event.wait() + ret = flush_request.event.wait(timeout_millis / 1e3) if not ret: _logger.warning("Timeout was exceeded in force_flush().") return ret