Skip to content

Commit

Permalink
Make sure background/shutdown threads are in AGENT_THREAD_GROUP
Browse files Browse the repository at this point in the history
  • Loading branch information
mcculls committed Jan 15, 2025
1 parent 6ece325 commit a3ab61d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.datadog.crashtracking;

import static datadog.trace.util.AgentThreadFactory.AGENT_THREAD_GROUP;
import static java.util.Comparator.reverseOrder;
import static java.util.Locale.ROOT;

Expand Down Expand Up @@ -92,6 +93,7 @@ static void writeConfig(Path scriptPath, String... entries) {
Runtime.getRuntime()
.addShutdownHook(
new Thread(
AGENT_THREAD_GROUP,
() -> {
try {
LOG.debug("Deleting config file: {}", cfgPath);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.datadog.profiling.controller;

import static datadog.trace.api.telemetry.LogCollector.SEND_TELEMETRY;
import static datadog.trace.util.AgentThreadFactory.AGENT_THREAD_GROUP;

import datadog.trace.api.config.ProfilingConfig;
import datadog.trace.bootstrap.config.provider.ConfigProvider;
Expand Down Expand Up @@ -297,6 +298,7 @@ private TempLocationManager() {

Thread selfCleanup =
new Thread(
AGENT_THREAD_GROUP,
() -> {
if (!waitForCleanup(1, TimeUnit.SECONDS)) {
log.info(
Expand Down

0 comments on commit a3ab61d

Please sign in to comment.