[
https://issues.apache.org/jira/browse/ARROW-1853?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16265880#comment-16265880
]
ASF GitHub Bot commented on ARROW-1853:
---------------------------------------
pcmoritz closed pull request #1358: ARROW-1853: [Plasma] Fix off-by-one error
in retry processing
URL: https://github.com/apache/arrow/pull/1358
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/cpp/src/plasma/io.cc b/cpp/src/plasma/io.cc
index 2228ad94c..2cba8970e 100644
--- a/cpp/src/plasma/io.cc
+++ b/cpp/src/plasma/io.cc
@@ -156,19 +156,14 @@ Status ConnectIpcSocketRetry(const std::string& pathname,
int num_retries,
if (timeout < 0) {
timeout = CONNECT_TIMEOUT_MS;
}
-
- *fd = -1;
- for (int num_attempts = 0; num_attempts < num_retries; ++num_attempts) {
- *fd = connect_ipc_sock(pathname);
- if (*fd >= 0) {
- break;
- }
- if (num_attempts == 0) {
- ARROW_LOG(ERROR) << "Connection to IPC socket failed for pathname " <<
pathname
- << ", retrying " << num_retries << " times";
- }
+ *fd = connect_ipc_sock(pathname);
+ while (*fd < 0 && num_retries > 0) {
+ ARROW_LOG(ERROR) << "Connection to IPC socket failed for pathname " <<
pathname
+ << ", retrying " << num_retries << " more times";
/* Sleep for timeout milliseconds. */
usleep(static_cast<int>(timeout * 1000));
+ *fd = connect_ipc_sock(pathname);
+ --num_retries;
}
/* If we could not connect to the socket, exit. */
if (*fd == -1) {
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> [Plasma] Fix off-by-one error in retry processing
> -------------------------------------------------
>
> Key: ARROW-1853
> URL: https://issues.apache.org/jira/browse/ARROW-1853
> Project: Apache Arrow
> Issue Type: Bug
> Reporter: Philipp Moritz
> Priority: Minor
> Labels: pull-request-available
> Fix For: 0.8.0
>
>
> When a user construct a plasma client that should not perform a single retry,
> by passing num_retries = 0, nothing happens due to an off-by-one error in the
> retry processing.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)