mirror of https://github.com/citusdata/citus.git
PQputCopyData's return value 0 should be considered fail (#7152)
parent
d5d1684c45
commit
d97f786296
|
@ -716,14 +716,14 @@ PutRemoteCopyData(MultiConnection *connection, const char *buffer, int nbytes)
|
||||||
Assert(PQisnonblocking(pgConn));
|
Assert(PQisnonblocking(pgConn));
|
||||||
|
|
||||||
int copyState = PQputCopyData(pgConn, buffer, nbytes);
|
int copyState = PQputCopyData(pgConn, buffer, nbytes);
|
||||||
if (copyState == -1)
|
if (copyState <= 0)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PQputCopyData may have queued up part of the data even if it managed
|
* PQputCopyData may have queued up part of the data even if it managed
|
||||||
* to send some of it succesfully. We provide back pressure by waiting
|
* to send some of it successfully. We provide back pressure by waiting
|
||||||
* until the socket is writable to prevent the internal libpq buffers
|
* until the socket is writable to prevent the internal libpq buffers
|
||||||
* from growing excessively.
|
* from growing excessively.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue