diff options
-rw-r--r-- | selftest/knownfail.d/local-messaging | 1 | ||||
-rw-r--r-- | source3/lib/messages_dgm.c | 16 |
2 files changed, 16 insertions, 1 deletions
diff --git a/selftest/knownfail.d/local-messaging b/selftest/knownfail.d/local-messaging deleted file mode 100644 index 46cf30c7316..00000000000 --- a/selftest/knownfail.d/local-messaging +++ /dev/null @@ -1 +0,0 @@ -^samba3.smbtorture_s3.LOCAL-MESSAGING-READ3 diff --git a/source3/lib/messages_dgm.c b/source3/lib/messages_dgm.c index b7f21ae97c5..90d253d8e26 100644 --- a/source3/lib/messages_dgm.c +++ b/source3/lib/messages_dgm.c @@ -1421,6 +1421,7 @@ int messaging_dgm_send(pid_t pid, struct messaging_dgm_context *ctx = global_dgm_context; struct messaging_dgm_out *out; int ret; + unsigned retries = 0; if (ctx == NULL) { return ENOTCONN; @@ -1428,6 +1429,7 @@ int messaging_dgm_send(pid_t pid, messaging_dgm_validate(ctx); +again: ret = messaging_dgm_out_get(ctx, pid, &out); if (ret != 0) { return ret; @@ -1437,6 +1439,20 @@ int messaging_dgm_send(pid_t pid, ret = messaging_dgm_out_send_fragmented(ctx->ev, out, iov, iovlen, fds, num_fds); + if (ret == ECONNREFUSED) { + /* + * We cache outgoing sockets. If the receiver has + * closed and re-opened the socket since our last + * message, we get connection refused. Retry. + */ + + TALLOC_FREE(out); + + if (retries < 5) { + retries += 1; + goto again; + } + } return ret; } |