-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not exit if pgpool is not reachable on startup #20
Comments
I patched this problem in my local installation by replacing the following snippet in if err != nil {
level.Error(Logger).Log("err", err)
os.Exit(1)
} With this: for err != nil {
level.Error(Logger).Log("err", err)
level.Info(Logger).Log("info", "sleeping for 5 seconds before trying to connect again")
time.Sleep(5 * time.Second)
db, err = getDBConn(dsn)
} Let me know if I can make a MR with this patch. :) |
@AnirudhGoel Thank you for reporting this issue. |
@AnirudhGoel Sorry for the late reply. |
Thank you @pengbo0328 for the test. Yes, I am creating a PR. |
Here it is. |
Thank you! @AnirudhGoel |
Currently on startup, if the exporter cannot connect to pgpool it throws an error and exits. This is okay if the pgpool connection parameters are incorrect but if the parameters are correct and pgpool is down, the exporter should just print the metric
up = 0
and wait for pgpool to be back up and not exit with an error.This behaviour causes an issue if the exporter is run as a sidecar container with pgpool and pgpool is waiting for searching a primary (
search_primary_node_timeout = 0
) for a few minutes. Then, after ~30 seconds, the exporter not being able to find the pgpool exits with an error and because one of the sidecar container is down, the orchestrator kills the whole job to restart it.The text was updated successfully, but these errors were encountered: