On Sun, Sep 8, 2024 at 2:08 PM Lars Kanis <l...@greiz-reinsdorf.de> wrote:
> To fix this issue the attached patch calls pqReadData() repeatedly in > PQconsumeInput() until there is no buffered SSL data left to be read. > Another solution could be to process buffered SSL read bytes in > PQisBusy() instead of PQconsumeInput() . > I've definitely seen this problem in AWS RDS, or something related to this. I'm using dblink to set up lots of connections and using dblink_is_busy (which calls PQconsumeInput). If there is lots of data being returned, say, with large results or log information, the server would stall for unknown reasons (sometimes for several seconds or more) while peeling off the 8kb fragments. Point being, PQconsumeInput() not draining the buffers can lead to major performance problems that are hard to troubleshoot. I would argue this a bug, really. merlin