← Back to team overview

mahara-contributors team mailing list archive

[Bug 1450680] [NEW] Need better log_debug output from lib/db/upgrade.php

 

Public bug reported:

One of the most annoying things about db locking up during upgrade is
you don't know where abouts in the upgrade you are - because it doesn't
error out.

It would be most useful if there was:

1) At least a log_debug line at the start of every if version block -
there are often comments there so just turn them into log_debug()
comments.

2) Every time we loop over a bunch of results we should have a loop counter, so upgrader knows things are still running eg:
  if ($results) {
    $count = 0;
    $limit = 1000;  // where limit is some appropriate number
    $total = count($results);
    foreach ($results as $result) {

       ... the purpose happens here ...

      $count++;
      if (($count % $limit) == 0 || $count == $total) {
          log_debug("$count/$total");
          set_time_limit(30);
      }
  }

** Affects: mahara
     Importance: Undecided
         Status: Confirmed

** Changed in: mahara
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1450680

Title:
  Need better log_debug output from lib/db/upgrade.php

Status in Mahara ePortfolio:
  Confirmed

Bug description:
  One of the most annoying things about db locking up during upgrade is
  you don't know where abouts in the upgrade you are - because it
  doesn't error out.

  It would be most useful if there was:

  1) At least a log_debug line at the start of every if version block -
  there are often comments there so just turn them into log_debug()
  comments.

  2) Every time we loop over a bunch of results we should have a loop counter, so upgrader knows things are still running eg:
    if ($results) {
      $count = 0;
      $limit = 1000;  // where limit is some appropriate number
      $total = count($results);
      foreach ($results as $result) {

         ... the purpose happens here ...

        $count++;
        if (($count % $limit) == 0 || $count == $total) {
            log_debug("$count/$total");
            set_time_limit(30);
        }
    }

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1450680/+subscriptions


Follow ups

References