[Olsr-dev] Poor routing performance

Mitar (spam-protected)
Wed Nov 10 16:16:13 CET 2010


Hi!

On Wed, Nov 10, 2010 at 3:54 PM, Markus Kittenberger
<(spam-protected)> wrote:
>> You do retry on EINTR/EAGAIN?
>
> I do not *G

This happens quite a lot if you use timers (SIGALRM, SIGVTALRM) in
your code. I believe olsrd is using that. ;-)

> so the os-specific code gets only one chance to do its job,.. (it might
> immediately retry (or do whatever) before it returns, but that`s it,..)
> one reason for this ist that it would get a bit complicated, to handle
> failure on this level

Not really. I use this in my code where I need something like this:

static int xioctl( int fd, int request, void *arg) {
  int r;

  do {
    r = ioctl(fd, request, arg);
  } while (-1 == r && EINTR == errno);

  return r;
}

You can also do some counter if things really hang.

I am not sure if we can just do the same for EAGAIN. EAGAIN mostly
happens on filedescriptors in non-blocking mode. But this also depends
on concrete implementation of given function you are wrapping this
way.

With EINTR it is OK just to retry immediately. That is the point of
this error. So that kernel does not need to think how to cleanup
things and try again, but just signals to the user this so all cleanup
is done the same as it would be otherwise and then user just retries.

It would be really great that all libraries in this world would use
system calls like that. Because then you do some interface to is from
some high-level programming language which is doing garbage collection
using SIGVTALRM and suddenly your calls mysteriously fail. MySQL lib
is (was?) a known example of this problem.

Of course this also means all open/write/read calls should be wrapped
like this. ;-)

>> We were getting "resource temporarily unavailable" with one iptables
>> daemon (captive portal) on this small boxes. And it solved all
>> problems we had. ;-)
>
> but here we got "already exists" error  ,..

I am not talking about Mac OS X anymore there. Yes, this is something
else and it is simply a problem that only one route to a destination
is possible.

But you should add that for (at least) Linux. ;-)


Mitar




More information about the Olsr-dev mailing list