Increase wal_sender_timeout to resolve the issue.
I've been investigating just this issue recently. See
https://www.postgresql.org/message-id/CAMsr+YE2dSfHVr7iEv1GSPZihitWX-PMkD9QALEGcTYa+sdsgg@mail.gmail.com
.
It would be very useful to me to know more about the transaction that
caused this problem.