@@ -1294,41 +1294,48 @@ impl DeploymentStore {
1294
1294
// Deployment head (current_ptr) advanced more than the error.
1295
1295
// That means it's healthy, and the non-deterministic error got
1296
1296
// solved (didn't happen on another try).
1297
+ //
1298
+ // This should be the scenario where the unfail happens, however
1299
+ // for now we unfail in all cases that non-deterministic errors
1300
+ // were found and the deployment head advanced.
1297
1301
( Bound :: Included ( error_block_number) , _)
1298
1302
if current_ptr. number >= error_block_number =>
1299
1303
{
1300
- info ! (
1301
- self . logger,
1302
- "Unfailing the deployment status" ;
1303
- "subgraph_id" => deployment_id,
1304
- ) ;
1305
-
1306
- // Unfail the deployment.
1307
- deployment:: update_deployment_status (
1308
- conn,
1309
- deployment_id,
1310
- deployment:: SubgraphHealth :: Healthy ,
1311
- None ,
1312
- ) ?;
1313
-
1314
- // Delete the fatal error.
1315
- deployment:: delete_error ( conn, & subgraph_error. id )
1316
1304
}
1317
- // NOOP, the deployment head is still before where non-deterministic error happened.
1305
+ // The deployment head is still before where non-deterministic error happened.
1306
+ //
1307
+ // Technically we shouldn't unfail the subgraph and delete the error
1308
+ // until it's head actually passed the error block range. But for
1309
+ // now we'll only log this and keep the old behavior.
1318
1310
block_range => {
1319
1311
info ! (
1320
1312
self . logger,
1321
- "Subgraph error is still ahead of deployment head, nothing to unfail " ;
1313
+ "Subgraph error is still ahead of deployment head" ;
1322
1314
"subgraph_id" => deployment_id,
1323
1315
"block_number" => format!( "{}" , current_ptr. number) ,
1324
1316
"block_hash" => format!( "{}" , current_ptr. hash) ,
1325
1317
"error_block_range" => format!( "{:?}" , block_range) ,
1326
1318
"error_block_hash" => subgraph_error. block_hash. as_ref( ) . map( |hash| format!( "0x{}" , hex:: encode( hash) ) ) ,
1327
1319
) ;
1328
-
1329
- Ok ( ( ) )
1330
1320
}
1331
- }
1321
+ } ;
1322
+
1323
+ info ! (
1324
+ self . logger,
1325
+ "Unfailing the deployment status" ;
1326
+ "subgraph_id" => deployment_id,
1327
+ ) ;
1328
+
1329
+ // Unfail the deployment.
1330
+ deployment:: update_deployment_status (
1331
+ conn,
1332
+ deployment_id,
1333
+ deployment:: SubgraphHealth :: Healthy ,
1334
+ None ,
1335
+ ) ?;
1336
+
1337
+ // Delete the fatal error.
1338
+ deployment:: delete_error ( conn, & subgraph_error. id )
1332
1339
} )
1333
1340
}
1334
1341
0 commit comments