Added content requests ISBNs with trailing text - causes memcache error

Bug #953299 reported by Dan Scott
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Invalid
Undecided
Unassigned
OpenSRF
Fix Released
Undecided
Unassigned

Bug Description

* Evergreen 2.1.x

In Import via Z39.50, attempting to import a record like the following http://laurentian.concat.ca/opac/en-CA/skin/lul/xml/rdetail.xml?r=2537766 results in errors like the following in the logs:

[ERR :11858:Cache.pm:124:] Unable to store ac.jacket.large.9780415590211 (hbk.) => [218 bytes] in memcached server

The reason is because the ISBN is not sufficiently sanitized before being passed to the Added Content service.

There are a few ways to handle this:

1) Reuse the ISBN sanitization routines from the OPAC for consistency in the Import from Z39.50 code
2) Teach the Added Content layer to sanitize the incoming key
3) Teach Cache.pm to sanitize requested memcache keys before attempting to store or retrieve them

Re: 2) - one might want to take the approach of passing record IDs into the Added Content service and teaching the service to extract the ISBN, LCCN, OCLCnum, UPC, MusicBrainz tag, Amazon ID, or other identifiers rather than restricting it to solely ISBN-as-key.

Revision history for this message
Dan Scott (denials) wrote :

Pushed user/dbs/lp953299/clean_cache_keys to the OpenSRF working repo to address method #3 -- sanitize keys for set/get just before passing them off to memcached. Also added a unit test for said issue.

This should be backported into OpenSRF's rel_2_1 branch.

tags: added: pullrequest
Revision history for this message
Galen Charlton (gmc) wrote :

Pushed collab/gmcharlt/lp953299/clean_cache_keys to the OpenSRF working repo; signs off original commit and adds another one to defend against misbehaving clients that try to use undefined or zero-length values as the key.

Revision history for this message
Dan Scott (denials) wrote :

Thanks Galen! I've picked your commit as well and pushed the lot to master and rel_2_1. Very much appreciated!

Changed in opensrf:
status: New → Fix Committed
milestone: none → 2.1.0-alpha
Changed in opensrf:
status: Fix Committed → Fix Released
Changed in evergreen:
status: New → Invalid
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.