Skip to content

Commit

Permalink
remove cancellation from failure summaries
Browse files Browse the repository at this point in the history
  • Loading branch information
pmossman committed Jan 20, 2022
1 parent ff57789 commit 7bf3c4c
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,3 @@ properties:
partialSuccess:
description: True if the number of committed records for this attempt was greater than 0. False if 0 records were committed.
type: boolean
cancelled:
description: Indicates whether this attempt was manually cancelled.
type: boolean
cancelledBy:
description: The user who cancelled the attempt.
type: string # TODO how do we represent users?
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ properties:
- permissionError
- systemRestart
- zombie
- manualCancellation
internalMessage:
description: Human readable failure description for consumption by technical system operators, like Airbyte engineers or OSS users.
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,7 @@ public void run(final ConnectionUpdaterInput connectionUpdaterInput) throws Retr
jobCreationAndStatusUpdateActivity.jobCancelled(
new JobCancelledInput(
maybeJobId.get(),
maybeAttemptId.get(),
FailureHelper.failureSummaryForCancellation(failures, partialSuccess, null) // TODO (parker) populate cancelledBy if available
)
);
maybeAttemptId.get()));
} else if (workflowState.isFailed()) {
reportFailure(connectionUpdaterInput);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ class JobCancelledInput {

private long jobId;
private int attemptId;
private AttemptFailureSummary attemptFailureSummary;

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ public void attemptFailure(final AttemptFailureInput input) {
public void jobCancelled(final JobCancelledInput input) {
try {
jobPersistence.cancelJob(input.getJobId());
jobPersistence.writeAttemptFailureSummary(input.getJobId(), input.getAttemptId(), input.getAttemptFailureSummary());
final Job job = jobPersistence.getJob(input.getJobId());
trackCompletion(job, JobStatus.FAILED);
jobNotifier.failJob("Job was cancelled", job);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import io.airbyte.config.StandardSyncInput;
import io.airbyte.scheduler.models.IntegrationLauncherConfig;
import io.airbyte.scheduler.models.JobRunConfig;
import io.airbyte.workers.helper.FailureHelper;
import io.airbyte.workers.temporal.TemporalJobType;
import io.airbyte.workers.temporal.scheduling.activities.ConfigFetchActivity;
import io.airbyte.workers.temporal.scheduling.activities.ConfigFetchActivity.GetMaxAttemptOutput;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public void setAttemptFailureWrapException() throws IOException {

@Test
public void setJobCancelled() throws IOException {
jobCreationAndStatusUpdateActivity.jobCancelled(new JobCancelledInput(JOB_ID, ATTEMPT_ID, ATTEMPT_FAILURE_SUMMARY));
jobCreationAndStatusUpdateActivity.jobCancelled(new JobCancelledInput(JOB_ID, ATTEMPT_ID));

Mockito.verify(mJobPersistence).cancelJob(JOB_ID);
}
Expand All @@ -214,7 +214,9 @@ public void setJobCancelledWrapException() throws IOException {
Mockito.doThrow(new IOException())
.when(mJobPersistence).cancelJob(JOB_ID);

Assertions.assertThatThrownBy(() -> jobCreationAndStatusUpdateActivity.jobCancelled(new JobCancelledInput(JOB_ID, ATTEMPT_ID, ATTEMPT_FAILURE_SUMMARY)))
Assertions
.assertThatThrownBy(
() -> jobCreationAndStatusUpdateActivity.jobCancelled(new JobCancelledInput(JOB_ID, ATTEMPT_ID)))
.isInstanceOf(RetryableException.class)
.hasCauseInstanceOf(IOException.class);
}
Expand Down

0 comments on commit 7bf3c4c

Please sign in to comment.