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 {
227227 ) ?;
228228 self . started_at = Some ( now) ;
229229 // 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+ {
231234 db. execute (
232235 "UPDATE experiments SET completed_at = ?1 WHERE name = ?2;" ,
233236 & [ & now, & self . name . as_str ( ) ] ,
Original file line number Diff line number Diff line change @@ -162,21 +162,28 @@ fn endpoint_error(
162162 data : Arc < Data > ,
163163 auth : AuthDetails ,
164164) -> 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 ( ) ) ) ?
166166 . ok_or_else ( || err_msg ( "no experiment run by this agent" ) ) ?;
167167
168+ ex. set_status ( & data. db , Status :: Failed ) ?;
169+
168170 if let Some ( ref github_issue) = ex. github_issue {
169171 Message :: new ( )
170172 . line (
171- "exclamation " ,
173+ "rotating_light " ,
172174 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" ) ) ,
175178 ) ,
176179 )
177180 . line (
181+ "hammer_and_wrench" ,
182+ "If the error is fixed use the `retry` command." ,
183+ )
184+ . note (
178185 "sos" ,
179- format ! ( "caused by: {}" , error . get ( "error" ) . unwrap ( ) , ) ,
186+ "Can someone from the infra team check in on this? @rust-lang/infra" ,
180187 )
181188 . send ( & github_issue. api_url , & data) ?;
182189 }
You can’t perform that action at this time.
0 commit comments