Skip to content

Commit 82b3778

Browse files
authored
fix(telemetry): register after fork hooks on initialization (backport #4319) (#4421)
This is an automatic backport of pull request #4319 done by [Mergify](https://mergify.com). --- <details> <summary>Mergify commands and options</summary> <br /> More conditions and actions can be found in the [documentation](https://docs.mergify.com/). You can also trigger Mergify actions by commenting on this pull request: - `@Mergifyio refresh` will re-evaluate the rules - `@Mergifyio rebase` will rebase this PR on its base branch - `@Mergifyio update` will merge the base branch into this PR - `@Mergifyio backport <destination>` will backport this PR on `<destination>` branch Additionally, on Mergify [dashboard](https://dashboard.mergify.com/) you can: - look at your merge queues - generate the Mergify configuration with the config editor. Finally, you can contact us on https://mergify.com </details>
1 parent 99c8069 commit 82b3778

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ddtrace/internal/telemetry/writer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def __init__(self, agent_url=None):
5454
self._integrations_queue = [] # type: List[Dict]
5555
self._lock = forksafe.Lock() # type: forksafe.ResetObject
5656
self._forked = False # type: bool
57+
forksafe.register(self._fork_writer)
5758

5859
self._headers = {
5960
"Content-type": "application/json",
@@ -278,7 +279,6 @@ def disable(self):
278279
if self.status == ServiceStatus.STOPPED:
279280
return
280281

281-
forksafe.unregister(self._fork_writer)
282282
atexit.unregister(self.stop)
283283

284284
self.stop()
@@ -295,5 +295,4 @@ def enable(self):
295295
self._enabled = True
296296
self.start()
297297

298-
forksafe.register(self._fork_writer)
299298
atexit.register(self.stop)

0 commit comments

Comments
 (0)