-
Notifications
You must be signed in to change notification settings - Fork 68
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
In some scenarios (source config update), updates to a preset's metric fetching interval are not applied to running gatherers
To Reproduce
Steps to reproduce the behavior:
- Run pgwatch with some preset, e.g.,
basic - Update the fetching interval for any metric in
basic - Update the monitored source and add a standby preset.
- Observe that the update to the fetching interval will never get applied
Expected behavior
Updates to metric fetching intervals should be applied.
Additional context
This happens because the update that added the standby preset, although not used anywhere, will cause md.Equal() in:
pgwatch/internal/reaper/reaper.go
Lines 398 to 404 in 4bae857
| if md.Equal(newMD.Source) { | |
| // replace with the existing connection if the source is the same | |
| newSrcs[i] = md | |
| continue | |
| } | |
| } | |
| r.monitoredSources = newSrcs |
to be false, hence dropping the old *SourceConn of that source from r.monitoredSources and use a new one, but the running gatherer will keep looking for updates from the old *SourceConn which has been dropped and will never get updated.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working