Commit 0233fc5
authored
Recover when connection cannot be established straight at startup (prometheus-community#415)
When the connection to the PostgreSQL instance cannot be established straight
at startup, a race condition can happen when autoDiscoverDatabases is true. If
discoverDatabaseDSNs fails, no dsn is set as the master database, and, if
scrapeDSN succeeds, checkMapVersions will have omitted the default metrics in
the server metric map. The metric map won't be updated unless the version
returned by the PostgreSQL instance changes. With this patch, scrapeDSN won't
be run unless discoverDatabaseDSNs succeeded and thus the race condition is
eliminated.
Signed-off-by: Yann Soubeyrand <[email protected]>1 parent 0391189 commit 0233fc5
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1624 | 1624 | | |
1625 | 1625 | | |
1626 | 1626 | | |
1627 | | - | |
1628 | 1627 | | |
1629 | 1628 | | |
1630 | 1629 | | |
1631 | 1630 | | |
1632 | 1631 | | |
| 1632 | + | |
1633 | 1633 | | |
1634 | 1634 | | |
1635 | 1635 | | |
| |||
0 commit comments