Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,16 @@ private void doDiscovery(State newState) {

if (log.isDebugEnabled()) {
log.debug(
"discovered traceEndpoint={}, metricsEndpoint={}, supportsDropping={}, supportsLongRunning={}, dataStreamsEndpoint={}, configEndpoint={}, evpProxyEndpoint={}, telemetryProxyEndpoint={}",
"discovered traceEndpoint={}, metricsEndpoint={}, supportsDropping={}, supportsLongRunning={}, dataStreamsEndpoint={}, configEndpoint={}, logEndpoint={}, snapshotEndpoint={}, diagnosticsEndpoint={}, evpProxyEndpoint={}, telemetryProxyEndpoint={}",
newState.traceEndpoint,
newState.metricsEndpoint,
newState.supportsDropping,
newState.supportsLongRunning,
newState.dataStreamsEndpoint,
newState.configEndpoint,
newState.debuggerLogEndpoint,
newState.debuggerSnapshotEndpoint,
newState.debuggerDiagnosticsEndpoint,
newState.evpProxyEndpoint,
newState.telemetryProxyEndpoint);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ private static boolean commonInit(Config config) {
Redaction.addUserDefinedTypes(config);
DDAgentFeaturesDiscovery ddAgentFeaturesDiscovery =
sharedCommunicationObjects.featuresDiscovery(config);
ddAgentFeaturesDiscovery.discoverIfOutdated();
// force to discover because commonInit can be retried if previously failed
ddAgentFeaturesDiscovery.discover();
agentVersion = ddAgentFeaturesDiscovery.getVersion();
String diagnosticEndpoint = getDiagnosticEndpoint(config, ddAgentFeaturesDiscovery);
ProbeStatusSink probeStatusSink =
Expand All @@ -152,6 +153,8 @@ private static boolean commonInit(Config config) {
return true;
} catch (Exception ex) {
LOGGER.debug("Failed to init common component for debugger agent", ex);
// reset commonInitDone to be able to retry commonInit next time
commonInitDone.set(false);
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ protected static boolean logHasErrors(Path logFilePath, Function<String, Boolean
}

protected static class MockDispatcher extends okhttp3.mockwebserver.QueueDispatcher {
private Function<RecordedRequest, MockResponse> dispatcher;
private volatile Function<RecordedRequest, MockResponse> dispatcher;

@Override
public MockResponse dispatch(RecordedRequest request) throws InterruptedException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,15 @@ void testExceptionReplayEnablement() throws Exception {
@Test
@DisplayName("testExceptionReplayEnablementFailure")
void testExceptionReplayEnablementFailure() throws Exception {
additionalJvmArgs.add("-Ddd.symbol.database.upload.enabled=false"); // enabled by default
additionalJvmArgs.add("-Ddd.exception.replay.enabled=true");
additionalJvmArgs.add("-Ddd.third.party.excludes=datadog.smoketest");
this.probeMockDispatcher.setDispatcher(this::noEndpointDispatch);
appUrl = startAppAndAndGetUrl();
waitForSpecificLine(appUrl, "Failed to init common component for debugger agent");
probeMockDispatcher.setDispatcher(this::datadogAgentDispatch);
setConfigOverrides(createConfigOverrides(true, true));
waitForFeatureStarted(appUrl, "Dynamic Instrumentation");
waitForFeatureStarted(appUrl, "Exception Replay");
}

private MockResponse noEndpointDispatch(RecordedRequest request) {
Expand Down
Loading