- Notifications
You must be signed in to change notification settings - Fork5
Commit592b615
committed
Fix incorrect timeout handling during initial authentication transaction.
The statement start timestamp was not set before initiating the transactionthat is used to look up client authentication information in pg_authid.In consequence, enable_sig_alarm computed a wrong value (far in the past)for statement_fin_time. That didn't have any immediate effect, because thetimeout alarm was set without reference to statement_fin_time; but if wesubsequently blocked on a lock for a short time, CheckStatementTimeoutwould consult the bogus value when we cancelled the lock timeout wait,and then conclude we'd timed out, leading to immediate failure of theconnection attempt. Thus an innocent "vacuum full pg_authid" would causefailures of concurrent connection attempts. Noted while testing other,more serious consequences of vacuum full on system catalogs.We should set the statement timestamp before StartTransactionCommand(),so that the transaction start timestamp is also valid. I'm not sure ifthere are any non-cosmetic effects of it not being valid, but the xacttimestamp is at least sent to the statistics machinery.Back-patch to 9.0. Before that, the client authentication timeout was doneoutside any transaction and did not depend on this state to be valid.1 parent6d7bd5d commit592b615
1 file changed
+2
-0
lines changedLines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
571 | 571 |
| |
572 | 572 |
| |
573 | 573 |
| |
| 574 | + | |
| 575 | + | |
574 | 576 |
| |
575 | 577 |
| |
576 | 578 |
| |
|
0 commit comments
Comments
(0)