[Linux-ha-dev] Re: [Linux-ha-cvs] Linux-HA CVS: lib by gshi from

Guochun Shi gshi at ncsa.uiuc.edu
Wed Feb 23 17:09:45 MST 2005


At 03:54 PM 2/23/2005 -0700, you wrote:
>linux-ha-cvs at lists.linux-ha.org wrote:
>>linux-ha CVS committal
>>Author  : gshi
>>Host    : Project : linux-ha
>>Module  : lib
>>Dir     : linux-ha/lib/clplumbing
>>
>>Modified Files:
>>        ipcsocket.c 
>>Log Message:
>>if channel is not connected,
>>a blocking send should return IPC_FAIL
>>===================================================================
>>RCS file: /home/cvs/linux-ha/linux-ha/lib/clplumbing/ipcsocket.c,v
>>retrieving revision 1.123
>>retrieving revision 1.124
>>diff -u -3 -r1.123 -r1.124
>>--- ipcsocket.c 11 Feb 2005 21:39:35 -0000      1.123
>>+++ ipcsocket.c 23 Feb 2005 18:05:29 -0000      1.124
>>@@ -1,4 +1,4 @@
>>-/* $Id: ipcsocket.c,v 1.123 2005/02/11 21:39:35 alan Exp $ */
>>+/* $Id: ipcsocket.c,v 1.124 2005/02/23 18:05:29 gshi Exp $ */
>> /*
>>  * ipcsocket unix domain socket implementation of IPC abstraction.
>>  *
>>@@ -767,6 +767,11 @@
>>        }
>>        
>>        while (ch->send_queue->current_qlen >= ch->send_queue->max_qlen){
>>+               if (ch->ch_status != IPC_CONNECT){
>>+                       cl_log(LOG_ERR, "socket_send:"
>>+                       " message queue exceeded and IPC not connected");
>>+                       return IPC_FAIL;
>>+               }
>>                cl_shortsleep();
>>                ch->ops->resume_io(ch);
>>        }
>
>I reread this code in context...  It's not as obvious as it could be... BUT, setting that aside...
>
>What is this "should_send_blocking" mode on the IPC channel?  The whole idea of this IPC code is that it should NEVER block.
>
>And, there doesn't appear to be any way to set this "should_send_blocking" flag on either...

There is no api to do that but a client can set it directly. By default IPC code is never blocked 
There are cases a client may want to wait until the send is done.


>A suggestion:  the name "should_send_blocking" is bad English too. should_send_block would be a better name.

OK, I will change it :)

-Guochun



More information about the Linux-HA-Dev mailing list