issue with host name lookup in PQconnectdb

From: dharani kumar <dharanikumarsrvn(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: issue with host name lookup in PQconnectdb
Date: 2016-12-01 13:51:13
Message-ID: CA+mRP7bpBv6Ui-H8yDVoWxbhf34EBGHo6_ff6moQyHL+ua1uVg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The problem i am facing is that PQconnectdb is blocking even though i
specified connect_timeout=10. My observation is below.
1. To simulate this issue, i stopped the postgreSQL-x64-9.4 service and
executed my application.
2. host=localhost is used, database present in the same machine.
3. I have a service created by NSSM, created out of my application exe.
4. My application doesn't blocks, the PQconnectDB fails instantaneously but
when ran as a service PQconnectDB blocks. No difference in code and
environment between exe and service.
5. The blocking issue in service gets eliminated when i replace host with
hostaddr=127.0.0.1. I thought maybe DNS lookup was the issue.

With these observation i tried to understand the nature and root cause of
the issue, could someone throw a light on this?

-Dharani

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Robert Inder 2016-12-01 13:55:39 Moving pg_xlog
Previous Message rob stone 2016-12-01 12:45:14 Re: About the MONEY type