Re: Use array as object (src/fe_utils/parallel_slot.c)
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Ranier Vilela <ranier.vf@gmail.com>, pgsql-hackers@postgresql.org
Date: 2022-08-22T00:15:41Z
Lists: pgsql-hackers
On Fri, Aug 19, 2022 at 02:22:32PM -0500, Justin Pryzby wrote: > If you trace the history back to a17923204, you'll see a comment about the > "zeroth slot", which makes it clear that the first slot it what's intended. > > I agree that it would be clearer if this were written as slots[0].connection. Based on the way the code is written on HEAD, this would be the correct assumption. Now, calling PQgetCancel() would return NULL for a connection that we actually ignore in the code a couple of lines above when it has PGINVALID_SOCKET. So it seems to me that the suggestion of using "cancelconn", which would be the first valid connection, rather than always the first connection, which may be using an invalid socket, is correct, so as we always have our hands on a way to cancel a command. -- Michael
Commits
-
Use correct connection for cancellation in frontend's parallel slots
- aeec3534ccf3 14.6 landed
- 44817d97bca3 15.0 landed
- 52144b6fcd62 16.0 landed
-
Refactor and generalize the ParallelSlot machinery.
- f71519e545a3 14.0 cited