File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,10 @@ impl Experiment {
227
227
) ?;
228
228
self . started_at = Some ( now) ;
229
229
// Check if the old status was "running" and there is no completed date
230
- } else if self . status == Status :: Running && self . completed_at . is_none ( ) {
230
+ } else if self . status == Status :: Running
231
+ && self . completed_at . is_none ( )
232
+ && status != Status :: Failed
233
+ {
231
234
db. execute (
232
235
"UPDATE experiments SET completed_at = ?1 WHERE name = ?2;" ,
233
236
& [ & now, & self . name . as_str ( ) ] ,
Original file line number Diff line number Diff line change @@ -162,21 +162,28 @@ fn endpoint_error(
162
162
data : Arc < Data > ,
163
163
auth : AuthDetails ,
164
164
) -> Fallible < Response < Body > > {
165
- let ex = Experiment :: run_by ( & data. db , & Assignee :: Agent ( auth. name . clone ( ) ) ) ?
165
+ let mut ex = Experiment :: run_by ( & data. db , & Assignee :: Agent ( auth. name . clone ( ) ) ) ?
166
166
. ok_or_else ( || err_msg ( "no experiment run by this agent" ) ) ?;
167
167
168
+ ex. set_status ( & data. db , Status :: Failed ) ?;
169
+
168
170
if let Some ( ref github_issue) = ex. github_issue {
169
171
Message :: new ( )
170
172
. line (
171
- "exclamation " ,
173
+ "rotating_light " ,
172
174
format ! (
173
- "Experiment **`{}`** running on agent `{}` has encountered an error" ,
174
- ex. name, auth. name,
175
+ "Experiment **`{}`** has encountered an error: {}" ,
176
+ ex. name,
177
+ error. get( "error" ) . unwrap_or( & String :: from( "no error" ) ) ,
175
178
) ,
176
179
)
177
180
. line (
181
+ "hammer_and_wrench" ,
182
+ "If the error is fixed use the `retry` command." ,
183
+ )
184
+ . note (
178
185
"sos" ,
179
- format ! ( "caused by: {}" , error . get ( "error" ) . unwrap ( ) , ) ,
186
+ "Can someone from the infra team check in on this? @rust-lang/infra" ,
180
187
)
181
188
. send ( & github_issue. api_url , & data) ?;
182
189
}
You can’t perform that action at this time.
0 commit comments