open-ils.cat.asset.copy_tree.retrieve.authoritative eats all my cstore's

Bug #1653742 reported by Bill Erickson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
2.10
Fix Released
Medium
Unassigned

Bug Description

Evergreen 2.11

Authoritative API calls instruct the CStoreEditor to conduct all communication with open-ils.cstore over a connected channel (so transactions can be used). The authoritative wrapper then instructs all still-open cstore connections to rollback and disconnect when the API call is complete. The end result is that cstore connections opened in this fashion (without any knowledge of the guts of the API code) are left connected for the duration of the API call. If enough cstore connections are created during API execution, it can exhaust a server's allotment of open-ils.cstore processes.

In the case of open-ils.cat.asset.copy_tree.retrieve.authoritative, it accepts a list of org unit ID for which copy data should be included in the result. A new cstore connection is created for each org unit, which persists for the duration of the API call.

The solution is to share an editor connection instead of creating a new one per org unit. This should also have the effect of making the API faster overall.

A similar issue was diagnosed in the hold details API:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=commitdiff;h=e8139016b921541ffd53f3e431d01e5faeef7994

Patch en route.

Tags: pullrequest
Revision history for this message
Bill Erickson (berick) wrote :

To test via srfsh using concerto data:

1. In one terminal:

% tail -f osrfsys.log | grep transaction.begin

2. In another terminal:

srfsh% request open-ils.cat open-ils.cat.asset.copy_tree.retrieve.authoritative "AUTHTOKEN", 217, [1,2,3,4,5,6,7,8,9]

3. 9 cstore transactions are opened before patching. After patching, only 1 is created.

===

Fix pushed:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1653742-copy-tree-authoritative-eats-cstores

tags: added: pullrequest
Changed in evergreen:
milestone: none → 2.11.2
assignee: Bill Erickson (berick) → nobody
Changed in evergreen:
milestone: 2.11.2 → 2.11.3
Revision history for this message
Galen Charlton (gmc) wrote :

Pushed to master, rel_2_11, and rel_2_10. Thanks, Bill!

Changed in evergreen:
importance: Undecided → Medium
status: New → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
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.