Review main Merged

26447[TASK] DatabaseConnection::isConnected() should use ping()

Markus Klein CR +2 V +2 Easy +6 −1 updated 02/03/14, 22:49

Commit message

In some rare cases the database connection might be down, but
DatabaseConnection still has isConnected set to TRUE.
A call to isConnected() simply returns the member variable's value.

Improve the getter to also ping() the database if the class thinks
it is connected to verify the connection state.

The other methods of the class will still use the member variable
and not the getter method to avoid a ping() to the database on every
database interaction.

Review

  • Code review CR +2
    • Stefan Neufeind +2
    • Wouter Wolters +1
    • Bill Dagou +1
  • Verified V +2
    • Stefan Neufeind +2
    • Bill Dagou +1

Issues 1

Files 1

Review log 9

  1. Mr. Jenkins commented on patch set 1 12/16/13, 11:34

  2. Christian Kuhn commented on patch set 1 12/16/13, 19:39

    DatabaseConnection.php:2994

    did you test this? $this->link is not an object in dbal, i'd expect calling parent fails here.
  3. Markus Klein commented on patch set 1 CR -1 12/16/13, 23:12

    DBAL change is not intended here.

    DatabaseConnection.php:2994 Reply

    Nope, this is indeed a mistake. I didn't want to commit this change here.
  4. Markus Klein uploaded patch set 2 12/16/13, 23:13

  5. Mr. Jenkins commented on patch set 2 12/16/13, 23:27

  6. Bill Dagou voted on patch set 2 V +1 CR +1 01/24/14, 07:45

  7. Wouter Wolters voted on patch set 2 CR +1 01/27/14, 21:47

  8. Stefan Neufeind commented on patch set 2 V +2 CR +2 02/03/14, 22:49

    Looks okay to me, works fine so far. Of course the "rare cases" are not really that easy to test :-)
  9. Stefan Neufeind merged patch set 3 02/03/14, 22:49