diff options
author | 2025-01-23 12:34:40 +0000 | |
---|---|---|
committer | 2025-01-23 15:34:05 +0000 | |
commit | 0cb3dec31d5a42ef00e89038aef1625179c8ac00 (patch) | |
tree | ef7028063f090712a3a0692380aecdcf2deb095e /cps-ri | |
parent | ed797d4a340ed145c71ae2cd805b823b26228304 (diff) |
Fix for cm handles stuck in LOCKED during registration
- Additional Error logging when cm handles fail module sync
- Swallow already defined exception upon schema and/or anchor creation
- Updated integration test to try to reproduce the problem (but couldn't)
- Ignored integration tests that depend/affected by race conditions
(they are useful for troubleshooting but not for pipeline checks)
- Removed last remnants of springboot retry annotation option (incl dependencies)
Issue-ID: CPS-2576
Change-Id: I910e802268332f955134c043bd1b46a7ec57233b
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
Diffstat (limited to 'cps-ri')
-rw-r--r-- | cps-ri/pom.xml | 4 | ||||
-rwxr-xr-x | cps-ri/src/main/java/org/onap/cps/ri/CpsModulePersistenceServiceImpl.java | 12 |
2 files changed, 1 insertions, 15 deletions
diff --git a/cps-ri/pom.xml b/cps-ri/pom.xml index 2492cb837e..f065421ec9 100644 --- a/cps-ri/pom.xml +++ b/cps-ri/pom.xml @@ -56,10 +56,6 @@ <artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
- <groupId>org.springframework.retry</groupId>
- <artifactId>spring-retry</artifactId>
- </dependency>
- <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</dependency>
diff --git a/cps-ri/src/main/java/org/onap/cps/ri/CpsModulePersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/ri/CpsModulePersistenceServiceImpl.java index 4f7492ff26..aaf6165471 100755 --- a/cps-ri/src/main/java/org/onap/cps/ri/CpsModulePersistenceServiceImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/ri/CpsModulePersistenceServiceImpl.java @@ -70,8 +70,6 @@ import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource; import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException; import org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangModelDependencyInfo; import org.springframework.dao.DataIntegrityViolationException; -import org.springframework.retry.RetryContext; -import org.springframework.retry.support.RetrySynchronizationManager; import org.springframework.stereotype.Component; @Slf4j @@ -269,18 +267,10 @@ public class CpsModulePersistenceServiceImpl implements CpsModulePersistenceServ yangResourceRepository.saveAll(newYangResourceEntities); } catch (final DataIntegrityViolationException dataIntegrityViolationException) { // Throw a CPS duplicated Yang resource exception if the cause of the error is a yang checksum - // database constraint violation. - // If it is not, then throw the original exception + // database constraint violation. If it is not, then throw the original exception final Optional<DuplicatedYangResourceException> convertedException = convertToDuplicatedYangResourceException( dataIntegrityViolationException, newYangResourceEntities); - convertedException.ifPresent( - e -> { - final RetryContext retryContext = RetrySynchronizationManager.getContext(); - int retryCount = retryContext == null ? 0 : retryContext.getRetryCount(); - log.warn("Cannot persist duplicated yang resource. System will attempt this method " - + "up to 5 times. Current retry count : {}", ++retryCount, e); - }); throw convertedException.isPresent() ? convertedException.get() : dataIntegrityViolationException; } } |