git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of ssh://git.onelab.eu/git/sliver-openvswitch
[sliver-openvswitch.git]
/
lib
/
worker.c
diff --git
a/lib/worker.c
b/lib/worker.c
index
b281d70
..
ce4a53b
100644
(file)
--- a/
lib/worker.c
+++ b/
lib/worker.c
@@
-37,6
+37,11
@@
VLOG_DEFINE_THIS_MODULE(worker);
VLOG_DEFINE_THIS_MODULE(worker);
+/* ovs_assert() logs the assertion message and logging sometimes goes through a
+ * worker, so using ovs_assert() in this source file could cause recursion. */
+#undef ovs_assert
+#define ovs_assert use_assert_instead_of_ovs_assert_in_this_module
+
/* Header for an RPC request. */
struct worker_request {
size_t request_len; /* Length of the payload in bytes. */
/* Header for an RPC request. */
struct worker_request {
size_t request_len; /* Length of the payload in bytes. */
@@
-237,11
+242,14
@@
worker_request_iovec(const struct iovec iovs[], size_t n_iovs,
worker_request_func *request_cb,
worker_reply_func *reply_cb, void *aux)
{
worker_request_func *request_cb,
worker_reply_func *reply_cb, void *aux)
{
+ static bool recursing = false;
struct worker_request rq;
struct iovec *all_iovs;
int error;
assert(worker_is_running());
struct worker_request rq;
struct iovec *all_iovs;
int error;
assert(worker_is_running());
+ assert(!recursing);
+ recursing = true;
rq.request_len = iovec_len(iovs, n_iovs);
rq.request_cb = request_cb;
rq.request_len = iovec_len(iovs, n_iovs);
rq.request_cb = request_cb;
@@
-255,6
+263,8
@@
worker_request_iovec(const struct iovec iovs[], size_t n_iovs,
VLOG_ABORT("send failed (%s)", strerror(error));
}
free(all_iovs);
VLOG_ABORT("send failed (%s)", strerror(error));
}
free(all_iovs);
+
+ recursing = false;
}
/* Closes the client socket, if any, so that worker_is_running() will return
}
/* Closes the client socket, if any, so that worker_is_running() will return
@@
-335,7
+345,7
@@
worker_reply_iovec(const struct iovec *iovs, size_t n_iovs,
* to avoid missing log messages. */
VLOG_INFO("send failed (%s)", strerror(error));
} else if (error) {
* to avoid missing log messages. */
VLOG_INFO("send failed (%s)", strerror(error));
} else if (error) {
- VLOG_
ABORT
("send failed (%s)", strerror(error));
+ VLOG_
FATAL
("send failed (%s)", strerror(error));
}
free(all_iovs);
}
free(all_iovs);
@@
-369,7
+379,7
@@
worker_main(int fd)
/* Main process closed the IPC socket. Exit cleanly. */
break;
} else if (error != EAGAIN) {
/* Main process closed the IPC socket. Exit cleanly. */
break;
} else if (error != EAGAIN) {
- VLOG_
ABORT("RPC receive failed (%s)", strerror
(error));
+ VLOG_
FATAL("RPC receive failed (%s)", ovs_retval_to_string
(error));
}
poll_fd_wait(server_sock, POLLIN);
}
poll_fd_wait(server_sock, POLLIN);
@@
-442,8
+452,6
@@
rxbuf_run(struct rxbuf *rx, int sock, size_t header_len)
}
}
}
}
}
}
-
- return EAGAIN;
}
static struct iovec *
}
static struct iovec *