Skip to content

Commit 35bd8be

Browse files
fix
1 parent a56fe56 commit 35bd8be

File tree

7 files changed

+25
-25
lines changed

7 files changed

+25
-25
lines changed

dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/ConfigurationUpdater.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void accept(Source source, Collection<? extends ProbeDefinition> definiti
9797
} catch (RuntimeException e) {
9898
ExceptionHelper.logException(LOGGER, e, "Error during accepting new debugger configuration:");
9999
LOGGER.debug("ANTITHESIS_ASSERT: ConfigurationUpdater.accept should sometimes throw a runtime exception (sometimes)");
100-
Assert.sometimes("ConfigurationUpdater.accept should sometimes throw a runtime exception");
100+
Assert.sometimes(true, "ConfigurationUpdater.accept should sometimes throw a runtime exception", null);
101101
throw e;
102102
}
103103
}
@@ -147,14 +147,14 @@ private void applyNewConfiguration(Configuration newConfiguration) {
147147
if (changes.hasProbeRelatedChanges()) {
148148
LOGGER.debug("Applying new probe configuration, changes: {}", changes);
149149
LOGGER.debug("ANTITHESIS_ASSERT: ConfigurationUpdater.handleProbesChanges should sometimes be called (sometimes)");
150-
Assert.sometimes("ConfigurationUpdater.handleProbesChanges should sometimes be called");
150+
Assert.sometimes(true, "ConfigurationUpdater.handleProbesChanges should sometimes be called", null);
151151
handleProbesChanges(changes, newConfiguration);
152152
}
153153
LOGGER.debug("ANTITHESIS_ASSERT: ConfigurationUpdater.applyNewConfiguration should always be successful (always)");
154-
Assert.always("ConfigurationUpdater.applyNewConfiguration should always be successful");
154+
Assert.always(true, "ConfigurationUpdater.applyNewConfiguration should always be successful", null);
155155
} finally {
156156
LOGGER.debug("ANTITHESIS_ASSERT: ConfigurationUpdater.applyNewConfiguration should always be reachable (reachable)");
157-
Assert.reachable("ConfigurationUpdater.applyNewConfiguration should always be reachable");
157+
Assert.reachable("ConfigurationUpdater.applyNewConfiguration should always be reachable", null);
158158
configurationLock.unlock();
159159
}
160160
}

dd-java-agent/agent-profiling/profiling-controller-openjdk/src/main/java/com/datadog/profiling/controller/openjdk/OpenJdkController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ private static String getJfrRepositoryBase(ConfigProvider configProvider) {
291291
} catch (IOException e) {
292292
log.error("Failed to create JFR repository directory: {}", repositoryPath, e);
293293
log.debug("ANTITHESIS_ASSERT: Failed to create JFR repository directory (unreachable)");
294-
Assert.unreachable("Failed to create JFR repository directory");
294+
Assert.unreachable("Failed to create JFR repository directory", null);
295295
throw new IllegalStateException(
296296
"Failed to create JFR repository directory: " + repositoryPath, e);
297297
}

dd-java-agent/agent-profiling/profiling-controller/src/main/java/com/datadog/profiling/controller/ProfilingSystem.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,11 @@ private void startProfilingRecording() {
198198
if (t instanceof IllegalStateException && "Shutdown in progress".equals(t.getMessage())) {
199199
ProfilerFlareLogger.getInstance().log("Shutdown in progress, cannot start profiling");
200200
log.debug("ANTITHESIS_ASSERT: Shutdown in progress, cannot start profiling (sometimes)");
201-
Assert.sometimes("Shutdown in progress, cannot start profiling");
201+
Assert.sometimes(true, "Shutdown in progress, cannot start profiling", null);
202202
} else {
203203
ProfilerFlareLogger.getInstance().log("Failed to start profiling", t);
204204
log.debug("ANTITHESIS_ASSERT: Failed to start profiling (unreachable)", t);
205-
Assert.unreachable("Failed to start profiling");
205+
Assert.unreachable("Failed to start profiling", null);
206206
throw t instanceof RuntimeException ? (RuntimeException) t : new RuntimeException(t);
207207
}
208208
}
@@ -280,7 +280,7 @@ public void snapshot(boolean onShutdown) {
280280
// JFR is filtering the stream it will only discard earlier chunks that have an end
281281
// time that is before (not before or equal to) the requested start time of the filter.
282282
log.debug("ANTITHESIS_ASSERT: Snapshot created (always) - lastSnapshot != null: {}", (lastSnapshot != null));
283-
Assert.always(lastSnapshot != null, "Snapshot created");
283+
Assert.always(lastSnapshot != null, "Snapshot created", null);
284284
lastSnapshot = recordingData.getEnd().plus(ONE_NANO);
285285
dataListener.onNewData(recordingType, recordingData, onShutdown);
286286
} else {
@@ -289,7 +289,7 @@ public void snapshot(boolean onShutdown) {
289289
} catch (final Exception e) {
290290
log.error(SEND_TELEMETRY, "Exception in profiling thread, continuing", e);
291291
log.debug("ANTITHESIS_ASSERT: Exception in profiling thread, continuing (unreachable)", e);
292-
Assert.unreachable("Exception in profiling thread, continuing");
292+
Assert.unreachable("Exception in profiling thread, continuing", null);
293293
} catch (final Throwable t) {
294294
/*
295295
Try to continue even after fatal exception. It seems to be useful to attempt to store profile when this happens.
@@ -303,7 +303,7 @@ public void snapshot(boolean onShutdown) {
303303
// This should almost never happen and there is not much we can do here in cases like
304304
// OutOfMemoryError, so we will just ignore this.
305305
log.debug("ANTITHESIS_ASSERT: Fatal exception in profiling thread, trying to continue (unreachable)");
306-
Assert.unreachable("Fatal exception in profiling thread, trying to continue");
306+
Assert.unreachable("Fatal exception in profiling thread, trying to continue", null);
307307
}
308308
}
309309
}

dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfiler.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public OngoingRecording start() {
190190
} catch (IOException | IllegalStateException e) {
191191
log.debug("Failed to start Datadog profiler recording", e);
192192
log.debug("ANTITHESIS_ASSERT: Failed to start Datadog profiler recording (unreachable)");
193-
Assert.unreachable("Failed to start Datadog profiler recording");
193+
Assert.unreachable("Failed to start Datadog profiler recording", null);
194194
return null;
195195
}
196196
}
@@ -206,15 +206,15 @@ void stopProfiler() {
206206
if (recordingFlag.compareAndSet(true, false)) {
207207
profiler.stop();
208208
log.debug("ANTITHESIS_ASSERT: Checking if profiling is still active after stop (sometimes) - active: {}", isActive());
209-
Assert.sometimes(isActive(),"Profiling is still active. Waiting to stop.");
209+
Assert.sometimes(isActive(),"Profiling is still active. Waiting to stop.", null);
210210
if (isActive()) {
211211
log.debug("Profiling is still active. Waiting to stop.");
212212
while (isActive()) {
213213
LockSupport.parkNanos(10_000_000L);
214214
}
215215
}
216216
log.debug("ANTITHESIS_ASSERT: Profiling should be stopped (always) - active: {}", isActive());
217-
Assert.always(!isActive(),"Profiling is stopped");
217+
Assert.always(!isActive(),"Profiling is stopped", null);
218218
}
219219
}
220220

@@ -229,7 +229,7 @@ public boolean isActive() {
229229
return !status.contains("not active");
230230
} catch (IOException ignored) {
231231
log.debug("ANTITHESIS_ASSERT: Failed to get Datadog profiler status (unreachable)");
232-
Assert.unreachable("Failed to get Datadog profiler status");
232+
Assert.unreachable("Failed to get Datadog profiler status", null);
233233
}
234234
return false;
235235
}
@@ -253,13 +253,13 @@ Path newRecording() throws IOException, IllegalStateException {
253253
}
254254
recordingFlag.set(false);
255255
log.debug("ANTITHESIS_ASSERT: Unable to start Datadog profiler recording (unreachable)");
256-
Assert.unreachable("Unable to start Datadog profiler recording");
256+
Assert.unreachable("Unable to start Datadog profiler recording", null);
257257
throw e;
258258
}
259259
return recFile;
260260
}
261261
log.debug("ANTITHESIS_ASSERT: Datadog profiler session has already been started (unreachable)");
262-
Assert.unreachable("Datadog profiler session has already been started");
262+
Assert.unreachable("Datadog profiler session has already been started", null);
263263
throw new IllegalStateException("Datadog profiler session has already been started");
264264
}
265265

dd-java-agent/agent-profiling/profiling-uploader/src/main/java/com/datadog/profiling/uploader/ProfileUploader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ public void onFailure(final Call call, final IOException e) {
303303
// sync request to a misbehaving server.
304304
if (handled.compareAndSet(false, true)) {
305305
log.debug("ANTITHESIS_ASSERT: Upload timeout (unreachable)");
306-
Assert.unreachable("Upload timeout");
306+
Assert.unreachable("Upload timeout", null);
307307
handleFailure(call, null, data, onCompletion);
308308
}
309309
}
@@ -355,7 +355,7 @@ private void handleResponse(
355355
JfrCliHelper.invokeOn(data, ioLogger);
356356
} else {
357357
log.debug("ANTITHESIS_ASSERT: Failed to upload profile (unreachable) - response code: {}", response.code());
358-
Assert.unreachable("Failed to upload profile");
358+
Assert.unreachable("Failed to upload profile", null);
359359
ioLogger.error("Failed to upload profile", getLoggerResponse(response));
360360
}
361361
}

dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/ProfilingAgent.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public void onNewData(RecordingType type, RecordingData data, boolean handleSync
8383
} catch (IOException e) {
8484
log.debug("Unable to write debug profile dump", e);
8585
log.debug("ANTITHESIS_ASSERT: Unable to write debug profile dump (unreachable)");
86-
Assert.unreachable("Unable to write debug profile dump");
86+
Assert.unreachable("Unable to write debug profile dump", null);
8787
}
8888
}
8989
}
@@ -173,14 +173,14 @@ public static synchronized boolean run(final boolean earlyStart, Instrumentation
173173
need to not forget to add code that removes this shutdown hook from JVM.
174174
*/
175175
log.debug("ANTITHESIS_ASSERT: Shutdown hook added (always) - uploader != null: {}", (uploader != null));
176-
Assert.always(uploader!= null, "Shutdown hook added");
176+
Assert.always(uploader!= null, "Shutdown hook added", null);
177177
Runtime.getRuntime().addShutdownHook(new ShutdownHook(profiler, uploader));
178178
} catch (final IllegalStateException ex) {
179179
// The JVM is already shutting down.
180180
}
181181
} catch (final UnsupportedEnvironmentException | ConfigurationException e) {
182182
log.debug("ANTITHESIS_ASSERT: Failed to initialize profiling agent (unreachable)", e);
183-
Assert.unreachable("Failed to initialize profiling agent!");
183+
Assert.unreachable("Failed to initialize profiling agent!", null);
184184
ProfilerFlareLogger.getInstance().log("Failed to initialize profiling agent!", e);
185185
ProfilerFlareReporter.reportInitializationException(e);
186186
}

remote-config/remote-config-core/src/main/java/datadog/remoteconfig/DefaultConfigurationPoller.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ private boolean initialize() {
284284
// We can't recover from this, so we'll not try to initialize again.
285285
log.error("Remote configuration poller initialization failed", e);
286286
log.debug("ANTITHESIS_ASSERT: Remote configuration poller initialization failed (unreachable)", e);
287-
Assert.unreachable("Remote configuration poller initialization failed");
287+
Assert.unreachable("Remote configuration poller initialization failed", null);
288288
fatalOnInitialization = true;
289289
}
290290
return true;
@@ -383,7 +383,7 @@ private void handleAgentResponse(ResponseBody body) {
383383
// no error can be reported, as we don't have the data client.state.targets_version avail
384384
ratelimitedLogger.warn("Error parsing remote config response", e);
385385
log.debug("ANTITHESIS_ASSERT: Error parsing remote config response (unreachable)", e);
386-
Assert.unreachable("Error parsing remote config response");
386+
Assert.unreachable("Error parsing remote config response", null);
387387
return;
388388
}
389389

@@ -452,7 +452,7 @@ private void runConfigurationEndListener(
452452
try {
453453
listener.onConfigurationEnd();
454454
log.debug("ANTITHESIS_ASSERT: Configuration end listener should always be reachable (reachable)");
455-
Assert.reachable("Configuration end listener should always be reachable");
455+
Assert.reachable("Configuration end listener should always be reachable", null);
456456
} catch (ReportableException re) {
457457
errors.add(re);
458458
} catch (RuntimeException rte) {
@@ -462,7 +462,7 @@ private void runConfigurationEndListener(
462462
ratelimitedLogger.warn(
463463
"Error running configuration listener {}: {}", listener, rte.getMessage(), rte);
464464
log.debug("ANTITHESIS_ASSERT: Error running configuration listener (unreachable)", rte);
465-
Assert.unreachable("Error running configuration listener");
465+
Assert.unreachable("Error running configuration listener", null);
466466
}
467467
}
468468

0 commit comments

Comments
 (0)