I'm sending this to hackers, because it is not exactly a bug, and it can't be addressed from userland. I think it is a coding issue, although I haven't identified the exact code.
When closing the local session which had used postgres_fdw over an ssl connection, I get log spam on the foreign server saying:
LOG: could not receive data from client: Connection reset by peer
It is easy to reproduce, but you must be using ssl to do so.
On searching, I see that a lot of people have run into this issue, with considerable confusion, but as far as I can see it has never been diagnosed.
Is there anything that can be done about this, other than just learning to ignore it?
Cheers,
Jeff