Skip to content

Commit

Permalink
add attempt created event to used codepath (#21955)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgardens authored Jan 27, 2023
1 parent b1a0a4d commit 3676a97
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,13 @@ public AttemptNumberCreationOutput createNewAttemptNumber(final AttemptCreationI
try {
final long jobId = input.getJobId();
ApmTraceUtils.addTagsToTrace(Map.of(JOB_ID_KEY, jobId));
final Job createdJob = jobPersistence.getJob(jobId);
final Job job = jobPersistence.getJob(jobId);

final WorkerRun workerRun = temporalWorkerRunFactory.create(createdJob);
final WorkerRun workerRun = temporalWorkerRunFactory.create(job);
final Path logFilePath = workerRun.getJobRoot().resolve(LogClientSingleton.LOG_FILENAME);
final int persistedAttemptNumber = jobPersistence.createAttempt(jobId, logFilePath);
emitJobIdToReleaseStagesMetric(OssMetricsRegistry.ATTEMPT_CREATED_BY_RELEASE_STAGE, jobId);
emitAttemptCreatedEvent(job, persistedAttemptNumber);

LogClientSingleton.getInstance().setJobMdc(workerEnvironment, logConfigs, workerRun.getJobRoot());
return new AttemptNumberCreationOutput(persistedAttemptNumber);
Expand Down

0 comments on commit 3676a97

Please sign in to comment.