Bug 191480 - ports-mgmt/pkg: pkg version locks database too long
Summary: ports-mgmt/pkg: pkg version locks database too long
Status: Closed Feedback Timeout
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Walter Schwarzenfeld
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-29 14:28 UTC by freebsd
Modified: 2019-02-25 14:15 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description freebsd 2014-06-29 14:28:02 UTC
Doing something like "pkg version -vL'=' can take several minutes especially on smaller devices. During the whole time the database is locked. This prevents any port being installed or removed. 
What I think is happening is something like this:
pkg creates a read cursor on the database and then walks from entry to entry to obtain the ports version through some make command.
What it could be doing instead (to prevent the long locks) is something like this:
Take the output of the query that was use to create the cursor and put it in a list then process that list as it did with results of the cursor.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2014-07-04 01:29:17 UTC
Over to maintainers.
Comment 2 Walter Schwarzenfeld freebsd_triage 2018-01-11 18:24:20 UTC
I think this is solved and can closed.
Comment 3 Walter Schwarzenfeld freebsd_triage 2019-02-25 14:15:27 UTC
Close here with Feedback timeout.