Skip to content

Commit b45051d

Browse files
committed
Update comments
1 parent f55d879 commit b45051d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/pg/lib/query.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,12 @@ class Query extends EventEmitter {
136136
this.emit('end', this._results)
137137
}
138138

139-
// in postgres 9.6 the backend sends both a command complete and error response
140-
// to a query which has timed out on rare, random occasions. If we send sync twice we will receive
141-
// to 'readyForQuery' events. I think this might be a bug in postgres 9.6, but I'm not sure...
139+
// In postgres 9.x & 10.x the backend sends both a CommandComplete and ErrorResponse
140+
// to the same query when it times out due to a statement_timeout on rare, random occasions. If we send sync twice we will receive
141+
// to ReadyForQuery messages . I hink this might be a race condition in some versions of postgres, but I'm not sure...
142142
// the docs here: https://www.postgresql.org/docs/9.6/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY
143-
// say "Therefore, an Execute phase is always terminated by the appearance of exactly one of these messages: CommandComplete, EmptyQueryResponse (if the portal was created from an empty query string), ErrorResponse, or PortalSuspended."
143+
// say "Therefore, an Execute phase is always terminated by the appearance of exactly one of these messages:
144+
// CommandComplete, EmptyQueryResponse (if the portal was created from an empty query string), ErrorResponse, or PortalSuspended."
144145
maybeSync(connection) {
145146
if (this.isPreparedStatement && !this._hasSentSync) {
146147
this._hasSentSync = true

0 commit comments

Comments
 (0)