Hi,
I am facing the exact same issue during my load testing since I upgraded CAS to version 7.1.0 with OIDC and SAML services.
While I haven't been able to find a solution yet, I can provide some additional information:
- Setting the property cas.service-registry.core.index-services to false makes the error disappear (but this is not a viable solution because with this setting OIDC services are no longer retrieved by the service registry).
- Protecting the problematic part of the code from concurrent access with a lock makes the error disappear:
  private void cacheRegisteredService(final RegisteredService service) {
    configurationContext.getServicesCache().put(service.getId(), service);
    if (configurationContext.getCasProperties().getServiceRegistry().getCore().isIndexServices()) {
      lock.tryLock(__ -> {
        indexedRegisteredServices.removeIf(registeredService -> registeredService.getId() == service.getId());
        indexedRegisteredServices.add(service);
      });
    }
  }
However, this is not a viable solution either, as it results in a significant performance loss (about 4 times slower).
- Changing the type of indexedRegisteredServices to ObjectLockingIndexedCollection or TransactionalIndexedCollection does not resolve the issue.
- If we remove the removeIf from the method, the error still appears but on the next line (the add).
I tried to go through the history of the AbstractServicesManager.java file, but I couldn't find any changes that might have caused this issue.
From what I understand, the problem seems to be caused by concurrent access to indexedRegisteredServices.
Nathan