Skip to content

Commit

Permalink
hack around shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
seemk committed Nov 8, 2023
1 parent 2f352ba commit b4f5db1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions splunk_otel/profiling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ def _profiler_loop(profiler: Profiler):
with profiler.condition:
profiler.condition.wait(wait_for)

# Hack around batch log processor getting stuck on application exits when the profiling endpoint is not reachable
# Could be related: https://github.com/open-telemetry/opentelemetry-python/issues/2284
# pylint: disable-next=protected-access
_profiler.exporter._shutdown = True
profiler.logger_provider.shutdown()
with profiler.condition:
profiler.condition.notify_all()
Expand Down Expand Up @@ -388,9 +392,6 @@ def stop_profiling():
return

_profiler.running = False
# Hack around batch log processor getting stuck on application exits when the profiling endpoint is not reachable.
# Could be related: https://github.com/open-telemetry/opentelemetry-python/issues/2284
_profiler.exporter.shutdown(timeout_millis=0)
with _profiler.condition:
# Wake up the profiler thread
_profiler.condition.notify_all()
Expand Down

0 comments on commit b4f5db1

Please sign in to comment.