Z39.50 Search - open-ils.search.z3950.search_class - occasional null results when use_perm in use
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Confirmed
|
Medium
|
Unassigned |
Bug Description
EG 3.11.1 but I think it has been an issue for a while.
When searching Z39.50 sources we are seeing the search results come back empty when they should have results. It was somewhat random when this would happen, the same search immediately repeated would sometimes keep failing and sometimes work successfully.
The searches are not actually getting sent to the remote z39.50 server, and we are not getting back that there were zero results, the call to open-ils.
We are using the restrict z39.50 sources by permission group feature.
https:/
We have two systems that each have their own set of Z39.50 servers. The use of that feature seems to be causing the problem.
This issue is hard to replicate, I think we started seeing it more because we have single VM dedicated to cataloging and acquisitions. So our z39.50 users are both hitting the same server that also doesn't have as much other searching going on.
The issue seems to be that the Z39.50 sources are cached in a %services hash, and when a user requests the list of sources that they have permission to use (open-ils.
I added a bunch of debugging notes to bug 1271559 before realizing that the original issue there didn't match what we were seeing.
I'll copy some of that over here.
Example of srfsh output from the problem.
**************
srfsh# request open-ils.search open-ils.
Received Data: {
"count":0,
"service":"oclc",
"records":[
]
}
-------
Request Completed Successfully
Request Time in seconds: 0.234018
-------
srfsh# request open-ils.search open-ils.
Received no data from server
-------
Request Completed Successfully
Request Time in seconds: 0.006879
-------
**************
=================
Steps to reproduce issue.
1. Have 2 or more users with different Z39.50 use_perm permissions, that are limited to different sets of z39.50 servers.
2. Grab or generate auth keys for those users.
3. Restart open-ils.search to clear the %services cache : osrf_control --restart --service open-ils.search -l
4. Watch your system logs for z3950 requests. tail -f /openils/
5. start srfsh and perform a request for user 1 to get the list of z39.50 servers they can access.
a. request open-ils.search open-ils.
b. Make note of which process handled the request from logs.
c. Process 50493 handled this request for example open-ils.search [INFO:50493:
6. Perform the request again for user 2. Hopefully you hit a different process. If you hit the same process you will need to go back and request for user 1 again.
7. Perform some searches and watch to see which process you hit. If you are searching using User2, and you hit the process that has the services for user1, then you will get a "Received no data from server" result.
Search example: Set your service name to match what you have.
srfsh# request open-ils.search open-ils.
=================
A simple fix is to not cache the results of the filtered open-ils.
Or maybe it would be better to cache before the filtering happens to not waste the db lookups?
Changed in evergreen: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
tags: | added: caching |
Changed in evergreen: | |
assignee: | nobody → Josh Stompro (u-launchpad-stompro-org) |
Working branch at: user/stompro/ lp2044854_ z3950_search_ failure
https:/ /git.evergreen- ils.org/ ?p=working/ Evergreen. git;a=shortlog; h=refs/ heads/user/ stompro/ lp2044854_ z3950_search_ failure