The problem is that when inserting a new node, we call HierarchyService.getChildNodes() in order to traverse the tree to find the desired parent. If that parent was just created by the job, it is not included in the list of children because that list is coming from the cache, which hasn't been updated.
I think we need to invalidate the cached children when a new one is added or removed.
Might only affect us due to our custom quartz job. Should be low risk to remove something from cache, as it will simply be retrieved from the database if it's missing. If anything it would affect the Evaluation or Delegated Access hierarchy.
We have a quartz job that creates our Evaluation site hierarchy that isn't working correctly after the cache was introduced (https://sakaiproject.atlassian.net/browse/SAK-33574#icft=SAK-33574).
The problem is that when inserting a new node, we call HierarchyService.getChildNodes() in order to traverse the tree to find the desired parent. If that parent was just created by the job, it is not included in the list of children because that list is coming from the cache, which hasn't been updated.
I think we need to invalidate the cached children when a new one is added or removed.