Re: Stuck on DBD DSO Lock

2013-02-06 Thread Nick Kew

On 5 Feb 2013, at 18:03, Reyad Attiyat wrote:

 The apr_dbd_get_driver call blocks in the child process  I should also note
 this doesn't block when I'm running apache in debug (-X) and that I'm using
 apache 2.4 with the event mpm.

Hmm.

 #4  0x7f59a03578fc in apu_dso_mutex_lock () at misc/apu_dso.c:46
 #5  0x7f59a034e036 in apr_dbd_get_driver (pool=pool@entry=0x21c2138,
name=0x7f599b1ea21c mysql, driver=0x230ee40) at dbd/apr_dbd.c:167

Looks like something else has that mutex when your function runs.

The mutex was changed in r659293, which shares the same mutex
between dbd and ldap, and makes it available to other modules.
Do you have ldap loaded, or anything else using apu_dso_mutex_lock
that you're aware of?

I don't like the logic of it.  A mutex should only be required if the driver
is not yet loaded.   Perhaps file a bug against APR?

 #6  0x7f599b1e4e8b in connect_database (db_pool=0x21c2138,
error_messages=0x7f599a7c7000, dbd_config=dbd_config@entry=0x2273940)
at database/dbd.c:35

Would it not make sense for your module to use mod_dbd to manage
a database connection pool?

-- 
Nick Kew


Stuck on DBD DSO Lock

2013-02-05 Thread Reyad Attiyat
Hello modules-dev,
Was not sure if I should post in this mailing list or apr but I
have trouble using apr-util and the mysql dbd driver. In my apache module i
make several mysql connections using the apr dbd functions. I make one
connection in the postconfig hook where I perform a directory
syncronization with file metadata to the database. This is done in a thread
and works fine. Next I connect in the child init hook. This is where
apr_dbd_mysql blocks on a pthread lock. It will only block when i build
apr-util with dso support. I'm using the most recent version apr 1.5. It's
my theory that you can only load the mysql driver dso once but how would it
be possible to use it in each child proccess and the main server process?

Thanks for your help.


Re: Stuck on DBD DSO Lock

2013-02-05 Thread Reyad Attiyat
To answer your second question, I'm using apr_dbd_open and apr_dbd_close as
well as calling apr_dbd_int only once in the post config hook.


On Tue, Feb 5, 2013 at 11:20 AM, Nick Kew n...@apache.org wrote:


 On 5 Feb 2013, at 16:51, Reyad Attiyat wrote:

  Hello modules-dev,
  Was not sure if I should post in this mailing list or apr but I
  have trouble using apr-util and the mysql dbd driver. In my apache
 module i
  make several mysql connections using the apr dbd functions. I make one
  connection in the postconfig hook where I perform a directory
  syncronization with file metadata to the database. This is done in a
 thread
  and works fine. Next I connect in the child init hook. This is where
  apr_dbd_mysql blocks on a pthread lock.

 What particular call blocks?
 I take it you're using matching apr_dbd_open and apr_dbd_close
 calls in all these (startup-time) functions?

 --
 Nick Kew