зеркало из https://github.com/mozilla/mig.git
[medium] don't conditionally run killDupAgents routine
We need to make sure we are actively draining the DetectDupAgents channel, otherwise routines writing here will end up blocking. We check the ctx.Agent.KillDupAgents setting inside killDupAgents, so just send the queue location here and it will be handled according to the configuration value.
This commit is contained in:
Родитель
ce85886a8e
Коммит
d5bf8854b8
|
@ -267,18 +267,16 @@ func startRoutines(ctx Context) {
|
||||||
ctx.Channels.Log <- mig.Log{Desc: "queue cleanup routine started"}
|
ctx.Channels.Log <- mig.Log{Desc: "queue cleanup routine started"}
|
||||||
|
|
||||||
// launch the routine that handles multi agents on same queue
|
// launch the routine that handles multi agents on same queue
|
||||||
if ctx.Agent.KillDupAgents {
|
go func() {
|
||||||
go func() {
|
for queueLoc := range ctx.Channels.DetectDupAgents {
|
||||||
for queueLoc := range ctx.Channels.DetectDupAgents {
|
ctx.OpID = mig.GenID()
|
||||||
ctx.OpID = mig.GenID()
|
err = killDupAgents(queueLoc, ctx)
|
||||||
err = killDupAgents(queueLoc, ctx)
|
if err != nil {
|
||||||
if err != nil {
|
ctx.Channels.Log <- mig.Log{Desc: fmt.Sprintf("%v", err)}.Err()
|
||||||
ctx.Channels.Log <- mig.Log{Desc: fmt.Sprintf("%v", err)}.Err()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}()
|
}
|
||||||
ctx.Channels.Log <- mig.Log{Desc: "killDupAgents() routine started"}
|
}()
|
||||||
}
|
ctx.Channels.Log <- mig.Log{Desc: "killDupAgents() routine started"}
|
||||||
|
|
||||||
// launch the routine that heartbeats the relays and terminates if connection is lost
|
// launch the routine that heartbeats the relays and terminates if connection is lost
|
||||||
go func() {
|
go func() {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче