Dexter, Gordon M. | 3 Jun 16:58 2010
Picon

[Trac-dev] Log concurrency issues?

I was looking into the logging code and I found that trac doesn't do much customization; just a standard python logging object.  That should work fine in some cases, since the Python logging object is thread-safe.  However it's not fully concurrency-safe for multiple processes, and we use Trac through mod_python, meaning there are always at least two apache processes running at any one time.  The trac log is env specific, but the environment isn't linked to a specific apache process, so it sounds like it's possible to lose log events.  Is there something I'm missing (e.g. special handling in mod_python) that prevents this?

--Gordon

--
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To post to this group, send email to trac-dev <at> googlegroups.com.
To unsubscribe from this group, send email to trac-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.

Noah Kantrowitz | 3 Jun 18:49 2010
Picon

Re: [Trac-dev] Log concurrency issues?

You can always use a backend like syslog that prevents this if you are  
worried.

--Noah

On Jun 3, 2010, at 7:58 AM, Dexter, Gordon M. wrote:

> I was looking into the logging code and I found that trac doesn't do  
> much customization; just a standard python logging object.  That  
> should work fine in some cases, since the Python logging object is  
> thread-safe.  However it's not fully concurrency-safe for multiple  
> processes, and we use Trac through mod_python, meaning there are  
> always at least two apache processes running at any one time.  The  
> trac log is env specific, but the environment isn't linked to a  
> specific apache process, so it sounds like it's possible to lose log  
> events.  Is there something I'm missing (e.g. special handling in  
> mod_python) that prevents this?
>
> --Gordon
>
>
> -- 
> You received this message because you are subscribed to the Google  
> Groups "Trac Development" group.
> To post to this group, send email to trac-dev <at> googlegroups.com.
> To unsubscribe from this group, send email to trac-dev+unsubscribe <at> googlegroups.com 
> .
> For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en 
> .

--

-- 
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To post to this group, send email to trac-dev <at> googlegroups.com.
To unsubscribe from this group, send email to trac-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.

anatoly techtonik | 4 Jun 10:33 2010
Picon

Re: [Trac-dev] Log concurrency issues?

Can somebody explain in more detail about the problem with two Apache
processes writing to the same log file? Is it because two processes
can not open the same file for writing simultaneously? If that is the
case - what will happen if 2nd Trac tries to access the opened file -
is it paused until the lock is released or fails immediately? Is this
error written to Apache error.log or Trac somehow intercepts and stubs
it?

I'd like to receive all complete information if my Trac misbehaves, so
if some of this info is lost - it is definitely bad for developers and
admin troubleshooters.

-- 
anatoly t.

On Thu, Jun 3, 2010 at 7:49 PM, Noah Kantrowitz <noah <at> coderanger.net> wrote:
> You can always use a backend like syslog that prevents this if you are
> worried.
>
> --Noah
>
> On Jun 3, 2010, at 7:58 AM, Dexter, Gordon M. wrote:
>
>> I was looking into the logging code and I found that trac doesn't do much
>> customization; just a standard python logging object.  That should work fine
>> in some cases, since the Python logging object is thread-safe.  However it's
>> not fully concurrency-safe for multiple processes, and we use Trac through
>> mod_python, meaning there are always at least two apache processes running
>> at any one time.  The trac log is env specific, but the environment isn't
>> linked to a specific apache process, so it sounds like it's possible to lose
>> log events.  Is there something I'm missing (e.g. special handling in
>> mod_python) that prevents this?
>>
>> --Gordon
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Trac Development" group.
>> To post to this group, send email to trac-dev <at> googlegroups.com.
>> To unsubscribe from this group, send email to
>> trac-dev+unsubscribe <at> googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/trac-dev?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Trac Development" group.
> To post to this group, send email to trac-dev <at> googlegroups.com.
> To unsubscribe from this group, send email to
> trac-dev+unsubscribe <at> googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/trac-dev?hl=en.
>
>

--

-- 
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To post to this group, send email to trac-dev <at> googlegroups.com.
To unsubscribe from this group, send email to trac-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.

anatoly techtonik | 4 Jun 10:34 2010
Picon

Re: [Trac-dev] Log concurrency issues?

Is the problem actual for mod_wsgi?

It wouldn't hurt to add process id in Trac log anyway.
-- 
anatoly t.

On Thu, Jun 3, 2010 at 7:49 PM, Noah Kantrowitz <noah <at> coderanger.net> wrote:
> You can always use a backend like syslog that prevents this if you are
> worried.
>
> --Noah
>
> On Jun 3, 2010, at 7:58 AM, Dexter, Gordon M. wrote:
>
>> I was looking into the logging code and I found that trac doesn't do much
>> customization; just a standard python logging object.  That should work fine
>> in some cases, since the Python logging object is thread-safe.  However it's
>> not fully concurrency-safe for multiple processes, and we use Trac through
>> mod_python, meaning there are always at least two apache processes running
>> at any one time.  The trac log is env specific, but the environment isn't
>> linked to a specific apache process, so it sounds like it's possible to lose
>> log events.  Is there something I'm missing (e.g. special handling in
>> mod_python) that prevents this?
>>
>> --Gordon
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Trac Development" group.
>> To post to this group, send email to trac-dev <at> googlegroups.com.
>> To unsubscribe from this group, send email to
>> trac-dev+unsubscribe <at> googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/trac-dev?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Trac Development" group.
> To post to this group, send email to trac-dev <at> googlegroups.com.
> To unsubscribe from this group, send email to
> trac-dev+unsubscribe <at> googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/trac-dev?hl=en.
>
>

--

-- 
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To post to this group, send email to trac-dev <at> googlegroups.com.
To unsubscribe from this group, send email to trac-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.


Gmane