Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: milo/appengine/buildbot/pubsub.go

Issue 2446273005: Milo: Fix issues with expiring builds due to builder disappearing (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The LUCI Authors. All rights reserved. 1 // Copyright 2016 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package buildbot 5 package buildbot
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "compress/gzip" 9 "compress/gzip"
10 "compress/zlib" 10 "compress/zlib"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 builder, ok := master.Builders[b.Buildername] 230 builder, ok := master.Builders[b.Buildername]
231 if !ok { 231 if !ok {
232 // Mark this build due to builder being removed. 232 // Mark this build due to builder being removed.
233 logging.Infof(c, "Expiring %s/%s/%d due to builder being removed", 233 logging.Infof(c, "Expiring %s/%s/%d due to builder being removed",
234 master.Name, b.Buildername, b.Number) 234 master.Name, b.Buildername, b.Number)
235 err = expireBuild(c, b) 235 err = expireBuild(c, b)
236 if err != nil { 236 if err != nil {
237 logging.WithError(err).Errorf(c, "Could not expi re build") 237 logging.WithError(err).Errorf(c, "Could not expi re build")
238 return 500 238 return 500
239 } 239 }
240 continue
hinoka 2016/10/27 01:31:22 Continue because we're done with this build
240 } 241 }
241 242
242 found := false 243 found := false
243 for _, bnum := range builder.CurrentBuilds { 244 for _, bnum := range builder.CurrentBuilds {
hinoka 2016/10/27 01:31:22 builder is nil here otherwise.
244 if b.Number == bnum { 245 if b.Number == bnum {
245 found = true 246 found = true
246 break 247 break
247 } 248 }
248 } 249 }
249 if !found { 250 if !found {
250 // Mark this build due to build not current anymore. 251 // Mark this build due to build not current anymore.
251 logging.Infof(c, "Expiring %s/%s/%d due to build not cur rent", 252 logging.Infof(c, "Expiring %s/%s/%d due to build not cur rent",
252 master.Name, b.Buildername, b.Number) 253 master.Name, b.Buildername, b.Number)
253 err = expireBuild(c, b) 254 err = expireBuild(c, b)
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 } 370 }
370 if master != nil { 371 if master != nil {
371 code := doMaster(c, master, internal) 372 code := doMaster(c, master, internal)
372 if code != 0 { 373 if code != 0 {
373 h.WriteHeader(code) 374 h.WriteHeader(code)
374 return 375 return
375 } 376 }
376 } 377 }
377 h.WriteHeader(200) 378 h.WriteHeader(200)
378 } 379 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698