Hello,On FreeBSD, when a client is disconnected by Corosync, there is an assert() that fails on the client side. The assert assumes that, since the poll() call was ok, recvmsg() will also be ok. However, this is not true on BSD systems. This patch makes sure EOF are correctly handled on BSD systems.
This problem appears to exist in the latest release (v1.2.8) and in trunk.
diff --git corosync/lib/coroipcc.c corosync/lib/coroipcc.c
index bbeb95f..a3e7d0d 100644
--- corosync/lib/coroipcc.c
+++ corosync/lib/coroipcc.c
@@ -874,13 +874,20 @@ coroipcc_dispatch_get (
}
error = socket_recv (ipc_instance->fd, &buf, 1);
+#if defined(COROSYNC_SOLARIS) || defined(COROSYNC_BSD) ||
defined(COROSYNC_DARWIN)
+ /* On many OS poll never return POLLHUP or POLLERR.
+ * EOF is detected when recvmsg return 0.
+ */
+ if ( error == CS_ERR_LIBRARY )
+ goto error_put;
+#endif
assert (error == CS_OK);
if (shared_mem_dispatch_bytes_left (ipc_instance) > 500000) {
/*
* Notify coroipcs to flush any pending dispatch messages
*/
-
+
res = ipc_sem_post (ipc_instance->control_buffer,
SEMAPHORE_REQUEST_OR_FLUSH_OR_EXIT);
if (res != CS_OK) {
error = CS_ERR_LIBRARY;
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ Openais mailing list [email protected] https://lists.linux-foundation.org/mailman/listinfo/openais
