Too many requests when loading Holdings Editor for multiple items

Bug #1930617 reported by Jeff Davis
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
3.7
Fix Committed
Medium
Unassigned
3.8
Fix Released
Medium
Unassigned

Bug Description

When you load the holdings editor to edit multiple items, it generates a lot of pcrud requests:

- parallel open-ils.pcrud.search.aca.atomic calls, one per item
- one open-ils.pcrud.search.bmp.atomic call per item
- redundant open-ils.pcrud.search.acnp.atomic and open-ils.pcrud.search.acns.atomic calls (one each per item, but with the same parameters in every case)

You can reproduce the behavior in at least two ways:

1. add multiple items to item bucket
2. Cataloguing > Item Buckets > retrieve bucket
3. select all items
4. Actions > Edit Selected Items

or:

1. in Item Status, scan multiple items (or load from CSV)
2. select all items
3. Actions > Edit > Items

If you're using one of these methods to edit a lot of items at once -- and we have libraries that edit 100+ items simultaneously like this -- it can lead to sudden large spikes in pcrud drone counts and potential performance issues/drone exhaustion.

It would be nice if we could batch or serialize the aca and bmp requests, and maybe cache the acnp/acns lookups since they only produce different results when you have different owning libraries.

tags: added: parallel-requests
Changed in evergreen:
assignee: nobody → Jeff Davis (jdavis-sitka)
Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

I think all these requests are happening in cat/volcopy/app.js, not surprisingly.

Looks like the parallel aca searches happen via the ItemSvc addCopy function, most likely when it is called by the fetchRaw function deep within the EditCtrl controller.

The bmp searches are from itemSvc.get_parts which is called in the egVolCopyEdit directive.

The acnp/acns searches are from itemSvc.get_prefixes and itemSvc.get_suffixes which are called in the egVolRow directive.

I'm not sure how to serialize these calls. Even the first one is a little too tricky for me.

Changed in evergreen:
assignee: Jeff Davis (jdavis-sitka) → nobody
Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

Actually, for acnp/acns, the best solution is probably not serializing but rather caching the results. Call number prefixes/suffixes are few in number and rarely change, so it would make sense to cache them on initial lookup, and then have get_prefixes and get_suffixes hit the cache first rather than doing a bunch of redundant pcrud calls.

Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

I don't see the same problem with the Angular holdings editor, but 3.8+ still uses the old AngJS holdings editor for my old test workflows (see bug 1956619).

Revision history for this message
Galen Charlton (gmc) wrote :
tags: added: angularjs cataloging pullrequest
Changed in evergreen:
status: New → Confirmed
Changed in evergreen:
assignee: nobody → Jeff Davis (jdavis-sitka)
Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

Works for me! Pushed to rel_3_8 through master (not sure if this should be pushed to rel_3_7?). Thanks, Galen!

Changed in evergreen:
milestone: none → 3.9.1
status: Confirmed → Fix Committed
assignee: Jeff Davis (jdavis-sitka) → nobody
Revision history for this message
Galen Charlton (gmc) wrote :

Thanks! I think a push to rel_3_7 wouldn't hurt; the performance fix is close enough to a security bugfix.

Revision history for this message
Jeff Davis (jdavis-sitka) wrote :

OK, pushed to rel_3_7 as well.

Galen Charlton (gmc)
Changed in evergreen:
importance: Undecided → Medium
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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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