Retry writes in the TCP, mcast, and serial listener plugins while sending

a response to clients, if the write fails or is incomplete.

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
This commit is contained in:
Ryan McCabe 2017-05-23 15:37:42 -04:00
parent 95a10ca43e
commit 647c144d82
3 changed files with 3 additions and 4 deletions

View File

@ -316,7 +316,7 @@ do_fence_request_tcp(fence_req_t *req, mcast_info *info)
}
dbg_printf(3, "Sending response to caller...\n");
if (write(fd, &response, 1) < 0) {
if (_write_retry(fd, &response, 1, NULL) < 0) {
perror("write");
}

View File

@ -239,9 +239,8 @@ do_fence_request(int fd, const char *src, serial_req_t *req, serial_info *info)
swab_serial_resp_t(&resp);
dbg_printf(3, "Sending response to caller...\n");
if (write(fd, &resp, sizeof(resp)) < 0) {
if (_write_retry(fd, &resp, sizeof(resp), NULL) < 0)
perror("write");
}
/* XVM shotguns multicast packets, so we want to avoid
* acting on the same request multiple times if the first

View File

@ -239,7 +239,7 @@ do_fence_request_tcp(int fd, fence_req_t *req, tcp_info *info)
}
dbg_printf(3, "Sending response to caller...\n");
if (write(fd, &response, 1) < 0) {
if (_write_retry(fd, &response, 1, NULL) < 0) {
perror("write");
}