Coda File System

Re: CVS Update: rpc2 (Lua bindings)

From: Jan Harkes <>
Date: Tue, 10 Apr 2007 15:41:49 -0400
On Tue, Apr 10, 2007 at 02:55:00PM -0400, Davor Ocelic wrote:
> On Tue, Apr 10, 2007 at 06:21:39PM +0000, Jan Harkes wrote:
> > +* We were not correctly handling returned data values in our Lua bindings.
> Hey, 
> what are Lua bindings used for ?

Introducing network failures or experimenting with different
retransmission algorithms. Check /usr/share/rpc2/*.lua for some

All applications linked against rpc2 will check for /etc/rpc2.lua, or
whatever location was specified by the RPC2_LUA_SCRIPT, and reload the
script if the file is modified. I've used it to simulate various types
of networks (cross-atlantic high latency/high bandwidth, or slow ppp)
between my client and the servers.

For instance it is possible to simulate random server failures, I have a
script that can be given MTBF and MTTR values and disconnects the client
us from a server. Network delay and failure is done by hooks that are
called whenever a packet is sent or received.

There are also some places where we call lua functions when we want to
know how long we should wait to send a retransmission, and whenever we
get a new roundtrip estimate. This way we don't have to rebuild rpc2 (or
even restart the client or server) when we want to tweak some variable
in the retransmission algorithm.

If there is a parse error or any other problem in the lua script it is
automatically disabled.

The problem that was fixed by this commit is that we were parsing
returned time values incorrectly. For some reason the liblua version in
Debian had no problem with this, but on FC5 it triggered an assertion.

Received on 2007-04-10 15:43:54