[Nut-upsdev] [PATCH] disable nonblocking mode on serial port

Jim Paris jim at jtan.com
Sun Oct 5 21:00:31 UTC 2008


Arjen de Korte wrote:
>> USB bulk transfers have potentially unbounded latency due to bus
>> conditions. Someone else might have a setup that includes forwarding
>> the serial port through a TCP/IP link to another machine.  Why assume?
>
> Because the whole purpose of using NUT is that you must have a reliable 
> connection to the UPS. There is no point in monitoring a UPS if you don't 
> have low (essentially zero) latency.

I don't follow.  I don't expect 100% reliability (there's a reason NUT
has a "connection lost" message) and I still see a point in monitoring
my UPS even if the status updates have a 250ms latency.

> I have considered using a select() here as well in the past. Coding this 
> is futile since we only have one write() statement in serial.c. I even 
> coded this a while back when I reworked serial.c (but never committed the 
> code). The problem is in a different area. How long should we wait? Too 
> short and you'd still fail miserably, too long and you risk breaking 
> existing installations.

How does "too long" risk breaking existing installations?  Before: We
got an error.  After: we wait a short while and maybe succeed.

> Since the demand for fixing this is low, I don't consider changing
> this any time soon.

Fine.

-jim



More information about the Nut-upsdev mailing list