The problem is in ow_server.c:ServerDir() (for example) where ToServer()
usually returns VERY quick and the request is put in a queue to be executed
on the remote-server.

If there are 10 different read requests to
/1wire/uncached/10.xxxxxxxxx/temperature from 10 different remote-clients,
then it could take 10 seconds before FromServerAlloc() return the first row
in a directory listing.

I can't see any possibility to keep the timeout here... The only possibility
would be to add a timeout around connect() and eventually abort the sequence
before sending the command too the remote-server. The read and write
commands should timeout by itself and return -1 upon failure.

Do you agree?

/Christian


-----Ursprungligt meddelande-----
Från: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] För Paul Alfille
Skickat: den 13 februari 2006 17:23
Till: owfs-developers@lists.sourceforge.net
Ämne: Re: [Owfs-developers] Timeout

Thanks, Christian.

We could go back to the old way, but I was trying to coordinate work with
the 
Link-Hub-E which can completely bomb out. 

I think the large directory listing should be ok, since the directory is
sent 
back one element at a time, which minimizes latency.

I've always wanted to implement owfake, allowing fake devices for testing.

Paul Alfille


On Monday 13 February 2006 04:08 am, Christian Magnusson wrote:
> I found out that the recently added read-timeout doesn't work good at all.
>
> A timeout of 1 second in ow_server.c is too low. Don't know exactly why,
> but I end up with EIO errors when reading temperatures very often.
>
>
>
> Host1:            owserver -d /dev/tty/1 (Slow Linksys router with 1-wire
> adapter connected.)
>
>                       owfs (connecting to host1)
>
>                       temploggerd (frequently writing 1 to
> /simultaneous/temperature and reading temperatures and full scandir() in
> /uncached)
>
>
>
> Host2:
>
>                       owfs (connecting to host1)
>
>                       temploggerd (frequently writing 1 to
> /simultaneous/temperature and reading temperatures and full scandir() in
> /uncached)
>
>
>
>
>
> Host3:            owfs
>
>                       cat /mnt/1wire/uncached/10.*/temperatures   (fails
> _very_ often with EIO errors)
>
>
>
>
>
> A command like "ls -l /1wire/uncached/" takes some time to execute, and
> that blocks the owserver for some time.
>
> If somebody else try to do a full scandir or using the 1-wire devices, the
> 1-second timeout is exceeded very easy.
>
>
>
> When I raised it to 10 seconds, it was 100% stable again. But is this
> enough for all situations? What happens if you have 1000 1-wire devices
and
> 2 hosts try to do a full scandir() ?
>
>
>
>
>
> I think it's important to protect the connect() in
ow_net.c:ClientConnect()
> too. connect() could hang for minutes if you don't get any packets back
> from the server.
>
>
>
>
>
> Any ideas?
>
>
>
> /Christian


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to