You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
Made stale sockets reconnect.
This commit is contained in:
@ -92,6 +92,7 @@ int SocketPool::send_recv(messageqcpp::ByteStream &in, messageqcpp::ByteStream *
|
|||||||
const uint8_t *inbuf = in.buf();
|
const uint8_t *inbuf = in.buf();
|
||||||
ssize_t err = 0;
|
ssize_t err = 0;
|
||||||
|
|
||||||
|
retry:
|
||||||
/* should there be a retry limit here... */
|
/* should there be a retry limit here... */
|
||||||
while (sock < 0)
|
while (sock < 0)
|
||||||
{
|
{
|
||||||
@ -103,13 +104,19 @@ int SocketPool::send_recv(messageqcpp::ByteStream &in, messageqcpp::ByteStream *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: make these writes not send SIGPIPE */
|
|
||||||
storagemanager::sm_msg_header hdr;
|
storagemanager::sm_msg_header hdr;
|
||||||
hdr.type = storagemanager::SM_MSG_START;
|
hdr.type = storagemanager::SM_MSG_START;
|
||||||
hdr.payloadLen = length;
|
hdr.payloadLen = length;
|
||||||
hdr.flags = 0;
|
hdr.flags = 0;
|
||||||
//cout << "SP sending msg on sock " << sock << " with length = " << length << endl;
|
//cout << "SP sending msg on sock " << sock << " with length = " << length << endl;
|
||||||
err = ::write(sock, &hdr, sizeof(hdr));
|
err = ::write(sock, &hdr, sizeof(hdr));
|
||||||
|
if (err < 0 && errno == EPIPE)
|
||||||
|
{
|
||||||
|
log(logging::LOG_TYPE_WARNING, "SocketPool: remote connection is closed, getting a new one");
|
||||||
|
remoteClosed(sock);
|
||||||
|
sock = -1;
|
||||||
|
goto retry;
|
||||||
|
}
|
||||||
sm_check_error;
|
sm_check_error;
|
||||||
while (count < length)
|
while (count < length)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user