mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 22:19:40 -08:00
Merge pull request #1915 from prometheus/release-1.0
Forward-merge the bug fix from release-1.0
This commit is contained in:
commit
4b8f963847
|
@ -1,3 +1,7 @@
|
||||||
|
## 1.0.2 / 2016-08-24
|
||||||
|
|
||||||
|
* [BUGFIX] Clean up old targets after config reload.
|
||||||
|
|
||||||
## 1.0.1 / 2016-07-21
|
## 1.0.1 / 2016-07-21
|
||||||
|
|
||||||
* [BUGFIX] Exit with error on non-flag command-line arguments.
|
* [BUGFIX] Exit with error on non-flag command-line arguments.
|
||||||
|
|
|
@ -180,8 +180,7 @@ type targetSet struct {
|
||||||
mtx sync.RWMutex
|
mtx sync.RWMutex
|
||||||
|
|
||||||
// Sets of targets by a source string that is unique across target providers.
|
// Sets of targets by a source string that is unique across target providers.
|
||||||
tgroups map[string][]*Target
|
tgroups map[string][]*Target
|
||||||
providers map[string]TargetProvider
|
|
||||||
|
|
||||||
scrapePool *scrapePool
|
scrapePool *scrapePool
|
||||||
config *config.ScrapeConfig
|
config *config.ScrapeConfig
|
||||||
|
@ -193,7 +192,6 @@ type targetSet struct {
|
||||||
|
|
||||||
func newTargetSet(cfg *config.ScrapeConfig, app storage.SampleAppender) *targetSet {
|
func newTargetSet(cfg *config.ScrapeConfig, app storage.SampleAppender) *targetSet {
|
||||||
ts := &targetSet{
|
ts := &targetSet{
|
||||||
tgroups: map[string][]*Target{},
|
|
||||||
scrapePool: newScrapePool(cfg, app),
|
scrapePool: newScrapePool(cfg, app),
|
||||||
syncCh: make(chan struct{}, 1),
|
syncCh: make(chan struct{}, 1),
|
||||||
config: cfg,
|
config: cfg,
|
||||||
|
@ -272,6 +270,11 @@ func (ts *targetSet) runProviders(ctx context.Context, providers map[string]Targ
|
||||||
}
|
}
|
||||||
ctx, ts.cancelProviders = context.WithCancel(ctx)
|
ctx, ts.cancelProviders = context.WithCancel(ctx)
|
||||||
|
|
||||||
|
// (Re-)create a fresh tgroups map to not keep stale targets around. We
|
||||||
|
// will retrieve all targets below anyway, so cleaning up everything is
|
||||||
|
// safe and doesn't inflict any additional cost.
|
||||||
|
ts.tgroups = map[string][]*Target{}
|
||||||
|
|
||||||
for name, prov := range providers {
|
for name, prov := range providers {
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue