On Fri, Jul 2, 2021 at 1:55 AM Jeff Davis <pg...@j-davis.com> wrote: > On Wed, 2021-06-30 at 12:25 -0400, Robert Haas wrote: > > I am not sure whether this works or not. Holding off cancel > > interrupts > > across possible network I/O seems like a non-starter. We have to be > > able to kill off connections that have wedged. > > I was following a pattern that I saw in CopyGetData() and > SocketBackend(). If I understand correctly, the idea is to avoid a > cancel leaving part of a message unread, which would desync the > protocol.
Right, that seems like a good goal. Thinking about this a little more, it's only holding off *cancel* interrupts, not *all* interrupts, so presumably you can still terminate the backend in this state. That's not so bad, and it's not clear how we could do any better. So I withdraw my previous complaint about this point. -- Robert Haas EDB: http://www.enterprisedb.com