mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-27 22:49:40 -08:00
Merge pull request #1308 from prometheus/rulefix
Fix hanging shutdown shortly after restart
This commit is contained in:
commit
19e81f81a0
|
@ -123,7 +123,11 @@ func (g *Group) run() {
|
|||
defer close(g.terminated)
|
||||
|
||||
// Wait an initial amount to have consistently slotted intervals.
|
||||
time.Sleep(g.offset())
|
||||
select {
|
||||
case <-time.After(g.offset()):
|
||||
case <-g.done:
|
||||
return
|
||||
}
|
||||
|
||||
iter := func() {
|
||||
start := time.Now()
|
||||
|
|
|
@ -55,6 +55,10 @@ func (rule RecordingRule) eval(timestamp model.Time, engine *promql.Engine) (mod
|
|||
result = query.Exec()
|
||||
vector model.Vector
|
||||
)
|
||||
if result.Err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
switch result.Value.(type) {
|
||||
case model.Vector:
|
||||
vector, err = result.Vector()
|
||||
|
|
Loading…
Reference in a new issue