aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2016-02-05 09:46:40 -0600
committerPeter Seebach <peter.seebach@windriver.com>2016-02-05 09:46:40 -0600
commit9e78667ea604fc0a8e538973973b48ae0741a8b2 (patch)
treeed6248427306369132bc1bce6b2373f401a1372c
parent735ac1b9ff7471b100f6758f9072bfd45e0e3f40 (diff)
downloadpseudo-9e78667ea604fc0a8e538973973b48ae0741a8b2.tar.gz
pseudo-9e78667ea604fc0a8e538973973b48ae0741a8b2.tar.bz2
pseudo-9e78667ea604fc0a8e538973973b48ae0741a8b2.zip
pseudo_client.c: don't abort on failure to start server
In some cases, there can be a race with multiple clients trying to start a server at once, and they should just retry their messages, rather than aborting. I haven't been able to consistently reproduce this, so it's not very well tested, but it seems reasonable.
-rw-r--r--ChangeLog.txt3
-rw-r--r--pseudo_client.c7
2 files changed, 4 insertions, 6 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index cac7d63..7c55464 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,6 @@
+2016-02-05:
+ * (seebs) don't abort search for server on first try.
+
2016-01-22:
* (seebs) Mask in S_IFREG when mknod called with no S_IFMT bits.
diff --git a/pseudo_client.c b/pseudo_client.c
index 4eb91df..570c861 100644
--- a/pseudo_client.c
+++ b/pseudo_client.c
@@ -1225,18 +1225,13 @@ pseudo_client_request(pseudo_msg_t *msg, size_t len, const char *path) {
do {
pseudo_debug(PDBGF_CLIENT | PDBGF_VERBOSE, "sending a message: ino %llu\n",
(unsigned long long) msg->ino);
- if (connect_fd < 0) {
- pseudo_debug(PDBGF_CLIENT, "trying to get server\n");
- if (pseudo_client_setup()) {
- return 0;
- }
- }
rc = pseudo_msg_send(connect_fd, msg, len, path);
if (rc != 0) {
pseudo_debug(PDBGF_CLIENT | PDBGF_VERBOSE, "msg_send: %d%s\n",
rc,
rc == -1 ? " (sigpipe)" :
" (short write)");
+ pseudo_debug(PDBGF_CLIENT, "trying to get server\n");
pseudo_client_setup();
++tries;
if (tries > 3) {