Log database backend pid

Bug #684669 reported by Jeroen T. Vermeulen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Medium
Jeroen T. Vermeulen

Bug Description

It'd be massively useful for debugging scripts if we would know what database backend processes were servicing them. We should log the backend PID when activating a store.

Stuart points at adapter.py as a good place to log this information. The backend PID is available as store._connection._raw_connection.get_backend_pid().

ISTM get_backend_pid will just forward to libpq's PQgetBackendPID, so all it should do is query the PGconn structure. Barely any performance cost at all.

Related branches

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Stuart also recommends logging at level DEBUG2, along with commits and aborts.

Revision history for this message
Launchpad QA Bot (lpqabot) wrote : Bug fixed by a commit
tags: added: qa-needstesting
Changed in launchpad-foundations:
status: In Progress → Fix Committed
Revision history for this message
Данило Шеган (danilo) wrote :

Assuming something like this is what we want, I am qa-ing this as OK.

2010-12-15 16:25:32 DEBUG Cronscript control file not found at file:cronscripts.ini
2010-12-15 16:25:32 INFO Creating lockfile: /var/lock/launchpad-rosetta-export-queue.lock
2010-12-15 16:25:50 DEBUG2 Connected to master backend 25004, as user poexport, at isolation level 1.
2010-12-15 16:25:50 DEBUG Removing lock file: /var/lock/launchpad-rosetta-export-queue.lock

tags: added: qa-ok
removed: qa-needstesting
Changed in launchpad:
status: Fix Committed → Fix Released
Curtis Hovey (sinzui)
Changed in launchpad:
milestone: none → 11.01
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.