Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip deletion error for action artifacts #33476

Merged
merged 1 commit into from
Feb 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions services/actions/cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ func cleanExpiredArtifacts(taskCtx context.Context) error {
}
if err := storage.ActionsArtifacts.Delete(artifact.StoragePath); err != nil {
log.Error("Cannot delete artifact %d: %v", artifact.ID, err)
continue
// go on
}
log.Info("Artifact %d set expired", artifact.ID)
log.Info("Artifact %d is deleted (due to expiration)", artifact.ID)
}
return nil
}
Expand All @@ -76,9 +76,9 @@ func cleanNeedDeleteArtifacts(taskCtx context.Context) error {
}
if err := storage.ActionsArtifacts.Delete(artifact.StoragePath); err != nil {
log.Error("Cannot delete artifact %d: %v", artifact.ID, err)
continue
// go on
}
log.Info("Artifact %d set deleted", artifact.ID)
log.Info("Artifact %d is deleted (due to pending deletion)", artifact.ID)
}
if len(artifacts) < deleteArtifactBatchSize {
log.Debug("No more artifacts pending deletion")
Expand All @@ -103,8 +103,7 @@ func CleanupLogs(ctx context.Context) error {
for _, task := range tasks {
if err := actions_module.RemoveLogs(ctx, task.LogInStorage, task.LogFilename); err != nil {
log.Error("Failed to remove log %s (in storage %v) of task %v: %v", task.LogFilename, task.LogInStorage, task.ID, err)
// do not return error here, continue to next task
continue
// do not return error here, go on
}
task.LogIndexes = nil // clear log indexes since it's a heavy field
task.LogExpired = true
Expand Down