@@ -205,6 +205,7 @@ pub async fn build_queue(
205
205
pub async fn enqueue_benchmark_request (
206
206
conn : & mut dyn database:: pool:: Connection ,
207
207
benchmark_request : & BenchmarkRequest ,
208
+ index : & BenchmarkRequestIndex ,
208
209
) -> anyhow:: Result < ( ) > {
209
210
let mut tx = conn. transaction ( ) . await ;
210
211
@@ -216,6 +217,8 @@ pub async fn enqueue_benchmark_request(
216
217
217
218
let backends = benchmark_request. backends ( ) ?;
218
219
let profiles = benchmark_request. profiles ( ) ?;
220
+ // Prevent the error from spamming the logs
221
+ let mut has_emitted_parent_sha_error = false ;
219
222
220
223
// Target x benchmark_set x backend x profile -> BenchmarkJob
221
224
for target in Target :: all ( ) {
@@ -237,15 +240,22 @@ pub async fn enqueue_benchmark_request(
237
240
// but was already benchmarked then the collector will ignore
238
241
// it as it will see it already has results.
239
242
if let Some ( parent_sha) = benchmark_request. parent_sha ( ) {
240
- tx. conn ( )
241
- . enqueue_benchmark_job (
242
- parent_sha,
243
- target,
244
- backend,
245
- profile,
246
- benchmark_set as u32 ,
247
- )
248
- . await ?;
243
+ if !has_emitted_parent_sha_error && !index. contains_tag ( parent_sha) {
244
+ log:: error!( "Parent tag; {parent_sha} does not exist in request benchmarks. Skipping" ) ;
245
+ has_emitted_parent_sha_error = true ;
246
+ }
247
+
248
+ if !has_emitted_parent_sha_error {
249
+ tx. conn ( )
250
+ . enqueue_benchmark_job (
251
+ parent_sha,
252
+ target,
253
+ backend,
254
+ profile,
255
+ benchmark_set as u32 ,
256
+ )
257
+ . await ?;
258
+ }
249
259
}
250
260
}
251
261
}
@@ -267,6 +277,7 @@ pub async fn enqueue_benchmark_request(
267
277
/// Returns benchmark requests that were completed.
268
278
async fn process_benchmark_requests (
269
279
conn : & mut dyn database:: pool:: Connection ,
280
+ index : & BenchmarkRequestIndex ,
270
281
) -> anyhow:: Result < Vec < BenchmarkRequest > > {
271
282
let queue = build_queue ( conn) . await ?;
272
283
@@ -282,7 +293,7 @@ async fn process_benchmark_requests(
282
293
break ;
283
294
}
284
295
BenchmarkRequestStatus :: ArtifactsReady => {
285
- enqueue_benchmark_request ( conn, & request) . await ?;
296
+ enqueue_benchmark_request ( conn, & request, index ) . await ?;
286
297
break ;
287
298
}
288
299
BenchmarkRequestStatus :: WaitingForArtifacts
@@ -306,7 +317,7 @@ async fn cron_enqueue_jobs(ctxt: &SiteCtxt) -> anyhow::Result<()> {
306
317
// Put the releases into the `benchmark_requests` queue
307
318
requests_inserted |= create_benchmark_request_releases ( & * conn, & index) . await ?;
308
319
// Enqueue waiting requests and try to complete in-progress ones
309
- let completed_reqs = process_benchmark_requests ( & mut * conn) . await ?;
320
+ let completed_reqs = process_benchmark_requests ( & mut * conn, & index ) . await ?;
310
321
311
322
// If some change happened, reload the benchmark request index
312
323
if requests_inserted {
0 commit comments