You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a web service running with multiprocessing and therefore cannot have a in-memory identity cache but must share them between the instances.
The documentation of the used shelve module for the identity cache says:
The shelve module does not support concurrent read/write access to shelved objects. (Multiple simultaneous read accesses are safe.) When a program has a shelf open for writing, no other program should have it open for reading or writing. Unix file locking can be used to solve this, but this differs across Unix versions and requires knowledge about the database implementation used.
But pysaml2 doesn't seem to have some locking around write operations.
The exception we receive from customer systems then are:
response = self.sp.parse_authn_request_response(message, binding, self.outstanding_queries)
File "/usr/lib/python3/dist-packages/saml2/client_base.py", line 717, in parse_authn_request_response
self.users.add_information_about_person(resp.session_info())
File "/usr/lib/python3/dist-packages/saml2/population.py", line 27, in add_information_about_person
session_info["not_on_or_after"])
File "/usr/lib/python3/dist-packages/saml2/cache.py", line 129, in set
self._db[cni] = data
File "/usr/lib/python3.7/shelve.py", line 125, in __setitem__
self.dict[key.encode(self.keyencoding)] = f.getvalue()
_dbm.error: cannot add item to database
We have a web service running with multiprocessing and therefore cannot have a in-memory identity cache but must share them between the instances.
The documentation of the used
shelve
module for the identity cache says:But pysaml2 doesn't seem to have some locking around write operations.
The exception we receive from customer systems then are:
The database is then in corrupt state:
related issues: #373 (maybe #741, #740).
The text was updated successfully, but these errors were encountered: