Hi Marty,
I looked through the ownet C code and see your point completely. I've fixed
the file descriptor leak and updated the persistent connection code as well.
Any reason why you are opening and closing connections repeatedly
(OWNET_init OWNET_close) rather than keeping one open and reusing it? I'm
glad you are doing the stress testing this way, but it wasn't the use
pattern I expected? (I thought the use of handles would be for different
owservers).
On Tue, Dec 18, 2012 at 2:59 PM, Marty Lee <[email protected]> wrote:
> Good evening,
>
> I've quickly added a bit of code to an existing application that polls an
> OWserver running on another host and have come across what I think may be
> a bug.
>
> OWFS 2.8p20 (module/ownet/c/src/c)
>
> Specifically, I have added a simple function to the code that calls..
>
> OWNET_init, OWNET_read then OWNET_close
>
> All sounds simple, until the process started to hang after running a while.
> Looking at the process using lsof, I found it had run out of file
> descriptors,
> as the fd table was full of net connections to the owserver.
>
> Looking through the code, it seems that in ow_connect.c around line 108,
> there
> is a case statement that is responsible for calling 'FreeClientAddr' for
> the
> 'bus_server' mode - however, FreeClientAddr doesn't actually close the fd.
>
> I've updated this case statement to check that 'target->iroutines.close' is
> valid, and if it is, call that instead - as the close routine does close
> the
> socket, and then calls FreeClientAddr itself.
>
> I may be miles of track with where the fix should really be applied, but
> unless
> I'm doing something wrong, looks like you've got a 'fd' leak with open
> sockets.
>
> Hope this is of some help...
>
> marty
>
>
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> Owfs-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/owfs-developers
>
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers