Skip to content

Commit

Permalink
Catch invalid patterns exception from dd.data.jobs.command.pattern (#…
Browse files Browse the repository at this point in the history
…7383)

Catch exception when compiling data jobs command pattern

Not failing tracer installation if the pattern is invalid
  • Loading branch information
paul-laffon-dd authored Aug 5, 2024
1 parent c08dc4f commit e0d4e22
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import java.util.EnumSet;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.regex.PatternSyntaxException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -1325,6 +1326,14 @@ private static boolean isDataJobsSupported(String javaCommand, String dataJobsCo
return true;
}

return javaCommand.matches(dataJobsCommandPattern);
try {
return javaCommand.matches(dataJobsCommandPattern);
} catch (PatternSyntaxException e) {
log.warn(
"Invalid data jobs command pattern {}. The value must be a valid regex",
dataJobsCommandPattern);
}

return true;
}
}

0 comments on commit e0d4e22

Please sign in to comment.