Traceback when a held message is not found in the store
I am getting this kind of traceback:
Nov 24 09:48:23 2015 (23934) REST request handler error:
Traceback (most recent call last):
File "/usr/lib64/python3.4/wsgiref/handlers.py", line 137, in run
self.result = application(self.environ, self.start_response)
File "/usr/lib/python3.4/site-packages/mailman/database/transaction.py", line 57, in wrapper
rtn = function(*args, **kws)
File "/usr/lib/python3.4/site-packages/mailman/rest/wsgiapp.py", line 104, in __call__
return super().__call__(environ, start_response)
File "falcon/api.py", line 213, in falcon.api.API.__call__ (falcon/api.c:2521)
File "falcon/api.py", line 182, in falcon.api.API.__call__ (falcon/api.c:2118)
File "/usr/lib/python3.4/site-packages/mailman/rest/post_moderation.py", line 135, in on_post
handle_message(self._mlist, request_id, **arguments)
File "/usr/lib/python3.4/site-packages/mailman/app/moderator.py", line 181, in handle_message
message_store.delete_message(message_id)
File "/usr/lib/python3.4/site-packages/mailman/database/transaction.py", line 92, in wrapper
return function(args[0], config.db.store, *args[1:], **kws)
File "/usr/lib/python3.4/site-packages/mailman/model/messagestore.py", line 134, in delete_message
raise LookupError(message_id)
LookupError: <316653960848401-WHUCHJZUZNJCAYGINSAUT@sqkfvguq.gregoryadams.com>
I don't know why the held message is not found in the store. My guess is that I tried to clean out the held messages on this list using a with_list
command line script, which failed at some point, so the database transaction was aborted but all messages before the failure were actually removed from the store. As a result I now have database requests but no corresponding message on the filesystem.
However the exact reason is not extremely important here, the thing is that we have two stores, one on the disk and one in the DB, and since they are not covered by the same transaction mechanism we must find a way to cope with the stores being out of sync if we want some robustness here.
How do you think we should do that? Check for the presence of the message on disk before returning the request in the REST API?