" java.io.IOException: Unexpected packet type: 25"
char 25 is EM. ( End of Medium)
I do not see it being part of the wire protocol, as for the same reason, not in pgjdbc handling i think.
I may be diverting that may not be related but a few things, just in case.
1) we once had a scenario of a bad nic driver e1000, that resulted in a lot of pkt losses.
We figured out there were too many pkt drops and upgraded the driver to vmnet or something.
2)You should also raise the same with pgjdbc. I see they have resolved issues with other mismatched packet types like 52 at their end.
3) I have had some arguments wrt pgjdbc/npgsql having issues with pgbouncer and not with postgresql directly. I counter by running the same queries using psql with pgbouncer. never got an error. But I am not an expert with Java so I keep an open mind and also raise this with the driver owners just in case as well as pgbouncer. else it is a deadlock :)
although this one is different issue, can you reproduce this case like above ?