Skip to content

Commit db45bf5

Browse files
authored
update logging in executor and sleep (#225)
To run down a cloud failure issue
1 parent 94713bc commit db45bf5

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

transact/src/main/java/dev/dbos/transact/database/StepsDAO.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,16 @@ public static Duration sleep(
282282
double endTime;
283283

284284
if (recordedOutput != null) {
285-
logger.debug("Replaying sleep, id: {}, millis: {}", functionId, duration.toMillis());
285+
logger.debug(
286+
"Replaying sleep, workflow {}, id: {}, duration: {}", workflowUuid, functionId, duration);
286287
if (recordedOutput.output() == null) {
287288
throw new IllegalStateException("No recorded timeout for sleep");
288289
}
289290
Object[] dser = JSONUtil.deserializeToArray(recordedOutput.output());
290291
endTime = (Double) dser[0];
291292
} else {
292-
logger.debug("Running sleep, id: {}, millis: {}", functionId, duration.toMillis());
293+
logger.debug(
294+
"Running sleep, workflow {}, id: {}, duration: {}", workflowUuid, functionId, duration);
293295
endTime = System.currentTimeMillis() + duration.toMillis();
294296

295297
try {
@@ -305,6 +307,13 @@ public static Duration sleep(
305307
double currentTime = System.currentTimeMillis();
306308
double durationms = Math.max(0, endTime - currentTime);
307309

310+
logger.debug(
311+
"sleep, endTime {}, currentTime: {}, durationMS: {}, skip: {}",
312+
endTime,
313+
currentTime,
314+
durationms,
315+
skipSleep);
316+
308317
if (!skipSleep) {
309318
try {
310319
logger.debug("Sleeping for duration {}", duration);

transact/src/main/java/dev/dbos/transact/execution/DBOSExecutor.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -963,10 +963,7 @@ public <T, E extends Exception> WorkflowHandle<T, E> executeWorkflow(
963963
DBOSContextHolder.clear();
964964
try {
965965
logger.debug(
966-
"executeWorkflow task {} {}",
967-
(Objects.requireNonNullElse(options.getTimeoutDuration(), Duration.ZERO)
968-
.toMillis()),
969-
Objects.requireNonNullElse(options.deadline(), Instant.EPOCH).toEpochMilli());
966+
"executeWorkflow task {}({}) {}", workflow.fullyQualifiedName(), args, options);
970967

971968
DBOSContextHolder.set(
972969
new DBOSContext(

0 commit comments

Comments
 (0)