@@ -88,11 +88,13 @@ const artifactUtils = {
88
88
prefix : obj . Key ,
89
89
} ) ) ) ;
90
90
91
+ // this will likely be a soft error, so we'll just log it
91
92
const err = new Error ( 'Failed to delete s3 objects' ) ;
92
93
err . entries = errors ;
93
94
monitor . reportError ( err ) ;
94
95
}
95
96
} catch ( err ) {
97
+ // and this is an api response error, most likely network issue or this needs to be retried
96
98
monitor . debug ( 'WARNING: Failed to delete expired artifacts: %s, %j' , err , err ) ;
97
99
if ( ! ignoreError ) {
98
100
throw err ;
@@ -109,7 +111,7 @@ const artifactUtils = {
109
111
110
112
// only s3 artifacts need to be deleted
111
113
// 'object' artifacts are deleted at expiration by the object service
112
-
114
+ // if this fails, we stop and don't delete the db entry
113
115
await Promise . all ( [
114
116
deleteObjects ( publicBucket , s3public ) ,
115
117
deleteObjects ( privateBucket , s3private ) ,
@@ -121,17 +123,18 @@ const artifactUtils = {
121
123
} ) ;
122
124
123
125
try {
124
- monitor . debug ( {
125
- message : 'Deleting artifacts from db' ,
126
- count : entries . length ,
127
- } ) ;
128
-
129
126
// delete all the artifacts from the db
130
127
await db . fns . delete_queue_artifacts (
131
- JSON . stringify ( entries . map ( ( { task_id, run_id, name } ) => ( { task_id, run_id, name } ) ) ) ,
128
+ JSON . stringify ( entries . map ( ( { taskId : task_id , runId : run_id , name } ) =>
129
+ ( { task_id, run_id, name } ) ) ) ,
132
130
) ;
133
131
134
132
count += entries . length ;
133
+ monitor . debug ( {
134
+ message : 'Deleted artifacts from db' ,
135
+ batch : entries . length ,
136
+ total : count ,
137
+ } ) ;
135
138
} catch ( err ) {
136
139
monitor . debug ( 'WARNING: Failed to delete expired artifacts: %s, %j' , err , err ) ;
137
140
// Rethrow error, if we're not supposed to ignore it.
0 commit comments