Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
maggie-lou committed Jan 16, 2025
1 parent 4d91abe commit 1688dae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2027,10 +2027,11 @@ func (s *SchedulerServer) reEnqueueTask(ctx context.Context, taskID, leaseID, re
if _, err := s.deleteTask(ctx, taskID); err != nil {
return err
}
msg := fmt.Sprintf("Task %q does not have retries enabled. Not re-enqueuing. Last failure: %s", taskID, reason)
if err := s.env.GetRemoteExecutionService().MarkExecutionFailed(ctx, taskID, status.InternalError(msg)); err != nil {
log.CtxWarningf(ctx, "Could not mark execution failed for task %q: %s", taskID, err)
}
log.Infof("Task %q does not have retries enabled. Not re-enqueing. Last failure: %s", taskID, reason)
log.Infof(msg)
return nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,13 +558,17 @@ func TestExecutorReEnqueue_RetriesDisabled(t *testing.T) {
taskID := scheduleTask(ctx, t, env, map[string]string{platform.ShouldRetryPropertyName: "false"})
fe.WaitForTask(taskID)
lease := fe.Claim(taskID)
fe.ResetTasks()

_, err := env.GetSchedulerClient().ReEnqueueTask(ctx, &scpb.ReEnqueueTaskRequest{
TaskId: taskID,
Reason: "for fun",
LeaseId: lease.leaseID,
})
require.Error(t, err)
require.NoError(t, err)

// Ensure the task was never re-enqueued
fe.EnsureTaskNotReceived(taskID)
}

func TestLeaseExpiration(t *testing.T) {
Expand Down

0 comments on commit 1688dae

Please sign in to comment.