[Patch] PQconnectPoll() is blocked if target_session_attrs isread-write - Mailing list pgsql-hackers

From Matsumura, Ryo
Subject [Patch] PQconnectPoll() is blocked if target_session_attrs isread-write
Date
Msg-id 03040DFF97E6E54E88D3BFEE5F5480F74AC15BBD@G01JPEXMBYT04
Whole thread Raw
Responses Re: [Patch] PQconnectPoll() is blocked if target_session_attrs isread-write
RE: [Patch] PQconnectPoll() is blocked if target_session_attrs isread-write
List pgsql-hackers
Hi

# I rewrote my previous mail.

PQconnectPoll() is used as method for asynchronous using externally or internally.
If a caller confirms a socket ready for writing or reading that is
requested by return value of previous PQconnectPoll(), next PQconnectPoll()
must not be blocked. But if the caller specifies target_session_attrs to
'read-write', PQconnectPoll() may be blocked.

Detail:
If target_session_attrs is set to read-write, PQconnectPoll() calls
PQsendQuery("SHOW transaction_read_only") althogh previous return value was
PGRES_POLLING_READING not WRITING.
In result, PQsendQuery() may be blocked in pqsecure_raw_write().

I attach a patch.

Regards
Ryo Matsumura

Attachment

pgsql-hackers by date:

Previous
From: "Tsunakawa, Takayuki"
Date:
Subject: RE: Speed up transaction completion faster after many relations areaccessed in a transaction
Next
From: David Rowley
Date:
Subject: Re: Speed up transaction completion faster after many relations areaccessed in a transaction