Skip to content

Commit 6ee2201

Browse files
authored
Do not remove evacuating actual LRP during cleanup (cloudfoundry#53)
Evacuating actual LRP will be removed by BBS convergence or after the replacement LRP is started. No need to bombard BBS during cell updates. This will minimize the drain time and it will actually stay close to the configured drain timeout. Cleanup is happening after the timeout is reached and BBS requests can overload BBS and cause it to timeout each request (10s) by default.
1 parent 3983069 commit 6ee2201

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

evacuation/cleanup.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ func (e *EvacuationCleanup) Run(signals <-chan os.Signal, ready chan<- struct{})
7878
}
7979

8080
strandedEvacuationCount++
81-
err = e.bbsClient.RemoveEvacuatingActualLRP(logger, traceID, &actualLRP.ActualLRPKey, &actualLRP.ActualLRPInstanceKey)
82-
if err != nil {
83-
logger.Error("failed-removing-evacuating-actual-lrp", err, lager.Data{"lrp-key": actualLRP.ActualLRPKey})
84-
}
8581
}
8682

8783
err = e.metronClient.SendMetric(strandedEvacuatingActualLRPsMetric, strandedEvacuationCount)

evacuation/cleanup_test.go

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -134,26 +134,6 @@ var _ = Describe("EvacuationCleanup", func() {
134134
cleanupProcess.Signal(os.Kill)
135135
})
136136

137-
It("removes all evacuating actual lrps associated with the cell", func() {
138-
Eventually(errCh).Should(Receive(nil))
139-
Expect(fakeBBSClient.ActualLRPsCallCount()).To(Equal(1))
140-
_, traceID, filter := fakeBBSClient.ActualLRPsArgsForCall(0)
141-
Expect(traceID).To(BeEmpty())
142-
Expect(filter).To(Equal(models.ActualLRPFilter{CellID: cellID}))
143-
144-
Expect(fakeBBSClient.RemoveEvacuatingActualLRPCallCount()).To(Equal(2))
145-
146-
_, traceID, lrpKey, lrpInstanceKey := fakeBBSClient.RemoveEvacuatingActualLRPArgsForCall(0)
147-
Expect(traceID).To(BeEmpty())
148-
Expect(*lrpKey).To(Equal(evacuatingActualLRP.ActualLRPKey))
149-
Expect(*lrpInstanceKey).To(Equal(evacuatingActualLRP.ActualLRPInstanceKey))
150-
151-
_, traceID, lrpKey, lrpInstanceKey = fakeBBSClient.RemoveEvacuatingActualLRPArgsForCall(1)
152-
Expect(traceID).To(BeEmpty())
153-
Expect(*lrpKey).To(Equal(evacuatingActualLRPWithReplacement.ActualLRPKey))
154-
Expect(*lrpInstanceKey).To(Equal(evacuatingActualLRPWithReplacement.ActualLRPInstanceKey))
155-
})
156-
157137
It("logs the number of stranded evacuating actual lrps", func() {
158138
Eventually(logger).Should(gbytes.Say("finished-evacuating.*\"stranded-evacuating-actual-lrps\":2"))
159139
})
@@ -318,16 +298,5 @@ var _ = Describe("EvacuationCleanup", func() {
318298
Expect(err).To(Equal(errors.New("failed")))
319299
})
320300
})
321-
322-
Describe("when removing the evacuating actual lrp fails", func() {
323-
BeforeEach(func() {
324-
fakeBBSClient.RemoveEvacuatingActualLRPReturns(errors.New("failed"))
325-
})
326-
327-
It("continues removing evacuating actual lrps", func() {
328-
Eventually(errCh).Should(Receive(nil))
329-
Expect(fakeBBSClient.RemoveEvacuatingActualLRPCallCount()).To(Equal(2))
330-
})
331-
})
332301
})
333302
})

0 commit comments

Comments
 (0)