ERP5Security: make ERP5GroupManager more resistant in extreme cases
When accessing an ERP5 Site, we might have automatic migration of tools. When this happens, we might not have yet access to scripts like ERP5Type_asSecurityGroupId. There was already try/except, so just move slightly more code inside.
-
Owner
Reading more of this method, it looks like it needs more work if we consider failure cases: currently, it will cache the value returned when it fails, and that value will survive current transaction. That's bad.
I believe the log statements need to raise, these exception must get through and get caught outside the caching wrapper. This way, incomplete values will not be cached.
If this becomes a performance issue, then a transactional cache should be used (maybe in addition to the short cache, maybe it could even replace it entirely... this would need more performance checking). If both caches are preserved, transactional cache will almost certainly be faster than the current one, so it should be checked first.
-
Hello. Thanks for your review. Your suggestion looks good. Though, I slightly improved a case that was not working with the minimal possible change (and this avoid other people having failing automatic update).
The case I had is really exceptional, it should only happens right after update of products.
It's impossible for me to do more on this at the moment due to some deadlines. If anyone else would like to improve further, I'm all ok with it.