Error out on send failure in walsender loop.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 4 Mar 2014 13:30:52 +0000 (15:30 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Tue, 4 Mar 2014 13:43:27 +0000 (15:43 +0200)
I changed the loop in 9.3 to use "goto send_failure" instead of "break" on
errors, but I missed this one case. It was a relatively harmless bug: if
the flush fails once it will most likely fail again as soon as we try to
flush the output again. But it's a bug nevertheless.

Report and fix by Andres Freund.

src/backend/replication/walsender.c

index cdd9c6a5334a13b952235487bedd6e738fedd9b3..a0338da0d465bb00e6bf2d134e7d9a599972d1c2 100644 (file)
@@ -1100,7 +1100,7 @@ WalSndLoop(void)
                    ping_sent = true;
                    /* Try to flush pending output to the client */
                    if (pq_flush_if_writable() != 0)
-                       break;
+                       goto send_failure;
                }
            }