Ah that's nice!

MySQL server has gone away                                                                           [warning]
query: SELECT t.nid FROM hosting_task t INNER JOIN node n ON t.vid = n.vid WHERE t.task_status = 0
GROUP BY t.rid ORDER BY n.changed, n.nid ASC LIMIT 20 database.mysqli.inc:134

Yep. For reference, here's what mysql commandline does:

mysql> select 1;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    7
Current database: aegirangelaanarc

+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.13 sec)

Comments

Steven Jones’s picture

I've had to handle a similar situation in D7, but there, and exception was thrown, not sure if we'll get one from the D6 DB layer, but if we do, you just catch it and try to re-connect and re-try the query.

Steven Jones’s picture

Yeah, so no exception, but if Drush is still around, we might just be able to get it to connect back up to the DB still.

ergonlogic’s picture

Status: Active » Needs review

On the dev/queued branch, in commit 85e19e5, I've added some database error-handling:

    if (db_error()) {
      // There was a database error, see: https://drupal.org/node/1992254
      drush_log('Caught database error. Restarting queue daemon.', 'warning');
      // Give the database time to come back.
      sleep(3);
      hosting_queued_restart();
    }
    else {
      // Get some tasks to run
      $tasks = @_hosting_get_new_tasks();
    }

I'm not sure 3 seconds is enough time for the database to come back. I'm considering making that configurable on the queued admin form.

ergonlogic’s picture

Status: Needs review » Fixed

We now wait for the database to come back. fixed in e3a7f3b.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.