[OPEN-ILS-DEV] Re: Puzzling problem: cannot open

Mike Rylander mrylander at gmail.com
Mon Jul 2 15:50:40 EDT 2007


On 7/1/07, Dan Scott <denials at gmail.com> wrote:
> On 01/07/07, Dan Scott <denials at gmail.com> wrote:
>
> <snip>
>
> > I'm not 100% sure, but I _hope_ that mode "a" is non-blocking. Or
> > perhaps we're going to have to look at using an equivalent open() call
> > in log.c as well? If I wasn't so damned lazy I would just write a
> > simple test C app and Perl app and test that hypothesis out on my own
> > system.
>
> Okay, so I decided not to be lazy and created a test C app & Perl app
> that cut the relevant lines out of their sources in OpenSRF and
> wrapped them in a minimal shell (with the C app just looping around a
> usleep(10000); fwrite(...); block to prove that it was successfully
> writing & holding the file pointer open).
>
> There was absolutely no problem having them both writing to the same
> file at the same time. So... hmm. Any ideas from here?

My gut tells me that we're overlooking something, and I can't find any
confirmation that mode "a" == O_NONBLOCK.  I've created a patch to use
open/growing_buffer/write instead of fopen/fprintf for the logging
output.  It adds some overhead because of the growing_buffer
management, but working beats not ... :)

It compiles, but it's untested.  But since you can cause the problem
on demand it should be simple(r than me) for you to test.

TIA

--miker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logging-via-open.patch
Type: text/x-patch
Size: 1161 bytes
Desc: not available
Url : http://list.georgialibraries.org/pipermail/open-ils-dev/attachments/20070702/e84c4298/logging-via-open.bin


More information about the Open-ils-dev mailing list