File deadlock.diff of Package rpm-ndb.26688

--- ./lib/transaction.c.orig	2021-10-08 13:40:11.816899736 +0000
+++ ./lib/transaction.c	2021-10-08 13:40:32.548851409 +0000
@@ -1549,6 +1549,9 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rp
 
     /* If we are in test mode, then there's no need for transaction lock. */
     if (!(rpmtsFlags(ts) & RPMTRANS_FLAG_TEST)) {
+	/* close read-only database before trying to acquire the lock */
+	if (ts->rdb != NULL && ts->dbmode != (O_RDWR|O_CREAT))
+	    (void) rpmtsCloseDB(ts);
 	if (!(txn = rpmtxnBegin(ts, RPMTXN_WRITE))) {
 	    goto exit;
 	}
openSUSE Build Service is sponsored by