Skip to content

Commit f2583e0

Browse files
committed
Reorder shutdown stuff
1 parent 3076c0f commit f2583e0

File tree

4 files changed

+4
-5
lines changed
  • exporter
    • opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc
    • opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http

4 files changed

+4
-5
lines changed

exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ def shutdown(self, timeout_millis: float = 30_000, **kwargs) -> None:
345345
if self._shutdown:
346346
logger.warning("Exporter already shutdown, ignoring call")
347347
return
348-
self._shutdown_is_occuring.set()
349348
self._shutdown = True
349+
self._shutdown_is_occuring.set()
350350
self._channel.close()
351351

352352
@property

exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/_log_exporter/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,9 @@ def shutdown(self):
201201
if self._shutdown:
202202
_logger.warning("Exporter already shutdown, ignoring call")
203203
return
204+
self._shutdown = True
204205
self._shutdown_is_occuring.set()
205206
self._session.close()
206-
self._shutdown = True
207-
208207

209208
def _compression_from_env() -> Compression:
210209
compression = (

exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/metric_exporter/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,9 @@ def shutdown(self, timeout_millis: float = 30_000, **kwargs) -> None:
249249
if self._shutdown:
250250
_logger.warning("Exporter already shutdown, ignoring call")
251251
return
252+
self._shutdown = True
252253
self._shutdown_is_occuring.set()
253254
self._session.close()
254-
self._shutdown = True
255255

256256
@property
257257
def _exporting(self) -> str:

exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ def shutdown(self):
195195
if self._shutdown:
196196
_logger.warning("Exporter already shutdown, ignoring call")
197197
return
198+
self._shutdown = True
198199
self._shutdown_is_occuring.set()
199200
self._session.close()
200-
self._shutdown = True
201201

202202
def force_flush(self, timeout_millis: int = 30000) -> bool:
203203
"""Nothing is buffered in this exporter, so this method does nothing."""

0 commit comments

Comments
 (0)