[Tickets #8671] Re: Nag::listAlarms fails when called from the scripts/alarms.php cron job

bugs at horde.org bugs at horde.org
Thu Nov 12 16:03:42 UTC 2009


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/8671
------------------------------------------------------------------------------
  Ticket             | 8671
  Updated By         | Valentin.Vidic at CARNet.hr
  Summary            | Nag::listAlarms fails when called from the
                     | scripts/alarms.php cron job
  Queue              | Nag
  Version            | 2.3.3
  Type               | Bug
  State              | Feedback
  Priority           | 2. Medium
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


Valentin.Vidic at CARNet.hr (2009-11-12 11:03) wrote:

> That doesn't make any sense because we use DB::connect() in the SQL  
> driver which already is a singleton. Besides that we only have a  
> single DB instance, the DB package also takes care of re-using open  
> database connections.

I added a print statement to connect and disconnect functions in  
DB/mysqli.php and called alarm cron job. It looks like DB connect  
get's called 2071 times (mostly from nag) without a single disconnect.  
And I would expect this as Nag::listAlarms gets called with a list of  
~2000 users and for each user it calls Nag_Driver::singleton($user).  
Since the $user is part of the instance signature, it creates a new  
Nag_Driver_sql instance for each user. And I don't see it trying to  
reuse existing connections in DB.php or DB/mysqli.php. I think you can  
reproduce this just by creating kronolith and nag alarms for a large  
number of users.






More information about the bugs mailing list