First of all, I have to apologise. Still no pastebin.

But a general tree would be something like that.

Main POE module, imported submodule1, imported submodule2. All 3
modules open the same logger conf and use the same sqlite file to
append the log. Theoretically the log file could be locked, if all 3
or even 2 modules try to write at the same time.
What would be the nice and tidy thing to do? Initialize logger in main
POE module and pass it to submodules?

I'm amazed, that lockups happens once in a blue moon. Maybe load is
still not that big, that events per second are low.

Thank you for your time.

On Wed, Oct 17, 2012 at 6:38 PM,  <p...@perlmeister.com> wrote:
> On Mon, 15 Oct 2012, Antti Linno wrote:
>
>> 1) Do POE's sessions run in parallel? (ok, this might be obvious, but
>> I have to be sure :) This might explain the database lock, as parallel
>> session could write at the same time. Oddly this crash
>> happens rarely.
>
>
> Is using the database spawning multiple processes within POE? POE by
> itself is single-process-single-threaded, but some components spawn
> multiple processes, like this one:
>
>
> http://cpansearch.perl.org/src/XANTUS/POE-Component-EasyDBI-1.23/lib/POE/Component/EasyDBI/SubProcess.pm
>
> If you have multiple processes within POE, then I guess getting a SQLite
> locked situation is possible.
>
>
>> 2) Does POE::Component::Log4perl cure this problem?
>
>
> This component is just a thin wrapper around Log4perl, and doesn't do
> much except provide an easy to use POE-like interface.
>
> If you're using a single-process-single-threaded POE application,
> Log4perl won't have issues with multiple writes to a file. If you have
> multiple processes, there's easy ways to avoid overlapping writes, as
> outlined in the Log4perl FAQ:
>
>
> http://search.cpan.org/dist/Log-Log4perl/lib/Log/Log4perl/FAQ.pm#How_can_I_synchronize_access_to_an_appender?
>
> --
> -- Mike
>
> Mike Schilli
> p...@perlmeister.com
>
>
>>
>> If there is no cure, will there be a problem with file based logging?
>> I can switch from SQL to grep based search.
>>
>> Thanks,
>> Antti
>>
>

Reply via email to