Bug 83236 - rpm leaves behind __db.00* lockfiles after any rpm query
rpm leaves behind __db.00* lockfiles after any rpm query
Status: CLOSED WORKSFORME
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
8.0
All Linux
high Severity high
: ---
: ---
Assigned To: Jeff Johnson
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-01-31 13:19 EST by M Glass
Modified: 2005-10-31 17:00 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-01-31 13:27:56 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description M Glass 2003-01-31 13:19:25 EST
Description of problem:
After having many troubles with rpm hangs, I performed the rpm 
database "recovery" (http://www.rpm.org/hintskinks/repairdb/), which gave no 
complaints.

(I have been trying to install an Openview Operations agent (has rpms), which 
was sporadically failing.  It uses an install script which basically does 
about six "rpm -i" commands to install its rpms.)

Somehow the database is in some state where any rpm command (that actually 
reads) will cause it to leave behind the /var/lib/rpm/__db.00* lock files.  
After this, database reads will work, but write operations will hang.  Even 
operations such as "--rebuilddb" will leave behind the lock files.  Queries 
for non-existant packages will also leave behind the files.


Version-Release number of selected component (if applicable):
4.1-1.06

How reproducible:

Steps to Reproduce:
1. Get a bad package installation that causes hangs (can be provided)
2. rpm -q anything
3. Note existence of lock files.
4. Delete lock files before you try anything that writes to database...
    
Actual results:
# ls /var/lib/rpm/__db.00* -l
-rw-r--r--+   1 root     root         8192 Jan 31 10:21 __db.001
-rw-r--r--+   1 root     root      1310720 Jan 31 10:21 __db.002
-rw-r--r--+   1 root     root       360448 Jan 31 10:21 __db.003

Expected results:
No lock files present.

Additional info:
Running base Red Hat 8.0 upgraded from 7.1. rpm version: rpm-4.1-1.06
Comment 1 Jeff Johnson 2003-01-31 13:27:56 EST
Note carefully:
    The __db files are not "lock files" but files that contain locks.

The existence of __db files is not your problem, the existence
of stale locks is.

There are 2 main causes of stale locks.
1) missed SIGCHLD causes rpm-4.1 to "hang"
    If using rpm-4.1-1.06, upgrade to rpm-4.1-9 packages
    from ftp://people.redhat.com/jbj/test-4.1, the missed
    SIGCHLD is fixed there.

2) abnormal termination (e.g. "kill -9") leaves stale locks
    It's up to the user to do "rm -f /var/lib/rpm/__db*" in this
    case.

A more complete description is in bugzilla, look for the summary
    rpm-4.1 hangs: READ THIS FIRST

Note You need to log in before you can comment on or make changes to this bug.