On Thu, May 27, 2010 at 12:13 PM, Michael Hanselmann <[email protected]> wrote:
> 2010/5/26 Guido Trotter <[email protected]>:
>> --- a/daemons/ganeti-masterd
>> +++ b/daemons/ganeti-masterd
>>  class ClientRequestWorker(workerpool.BaseWorker):
>>    # pylint: disable-msg=W0221
>> -  def RunTask(self, server, request, client_address):
>> +  def RunTask(self, server, message, client):
>>     """Process the request.
>>
>>     """
>> […]
>> +
>> +    # FIXME: send data via push :)
>> +    client.connected_socket.sendall(luxi.FormatResponse(success, result)
>> +                                    + constants.LUXI_EOM)
>
> Apart from the fact that the operator goes to the previous line: If
> the master thread still tries to read from the socket while the
> request is handled (I guess it does), and the client sends more
> requests, the replies could be intermixed as different threads will
> write their replies whenever they're ready. LUXI is a synchronous
> protocol, hence ordering is important. Is this already taken care of?
>

True enough. Probably for the first version a lock around sending
would be enough (and not slow down anything, since it's
per-connection).
BTW while we're at it: does request/response order count in LUXI?
With the old version we would be guaranteed to have

M1\3M2\3M3\3 leading to R1\3R2\3R3

With the new one we could have

M1\3M2\3M3\3 giving R2\3R3\3R1

Depending on the time various requests take to process. I don't think
we use luxi in a way that matters, but just wondering.

Thanks,

Guido

Reply via email to