Export to GitHub

nurpawiki - issue #29

Nurpawiki does not handle restart of Postgresql as it loses DB connection


Posted on Dec 10, 2007 by Happy Lion

What steps will reproduce the problem? 1. Start Ocsigen+Nurpawiki 2. Login 3. Restart postgresql 4. Navigate to main page of Nurpawiki

What is the expected output? What do you see instead?

Expected output is to see the main page.

Instead, I see Nurpawiki suggesting for a DB upgrade. After editing the URL to point to main page, I get Error 500.

Apparently DB connection is lost on server restart. The DB code in Nurpawiki needs to somehow deal with this.

Comment #1

Posted on Dec 10, 2007 by Happy Lion

From psql docs (http://www.postgresql.org/docs/7.4/interactive/libpq-status.html):

 Returns the status of the connection.

ConnStatusType PQstatus(const PGconn *conn);

The status can be one of a number of values. However, only two of these are seen

outside of an asynchronous connection procedure: CONNECTION_OK and CONNECTION_BAD. A good connection to the database has the status CONNECTION_OK. A failed connection attempt is signaled by status CONNECTION_BAD. Ordinarily, an OK status will remain so until PQfinish, but a communications failure might result in the status changing to CONNECTION_BAD prematurely. In that case the application could try to recover by calling PQreset.

See the entry for PQconnectStart and PQconnectPoll with regards to other status

codes that might be seen.

Comment #2

Posted on Dec 13, 2007 by Happy Lion

(No comment was entered for this change.)

Comment #3

Posted on Dec 16, 2007 by Happy Lion

(No comment was entered for this change.)

Comment #4

Posted on Jan 1, 2008 by Happy Lion

Changes in r322 and r324 should make this problem go mostly away.

Status: Fixed

Labels:
Type-Defect Priority-Medium Milestone-Release1.1 Component-Persistence Security