mirror of
				https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
				synced 2025-11-03 20:17:53 +00:00 
			
		
		
		
	WIFI-540: Added more robust exception handling to prevent crashing registration thread during
cleaning up of stale records. Also removed the base dependencies from opensync-process that are coming from opensync-ext-cloud.
This commit is contained in:
		@@ -411,6 +411,7 @@ public class OpensyncCloudGatewayController {
 | 
			
		||||
     */
 | 
			
		||||
    protected void cleanupStaleGwRecord() {
 | 
			
		||||
        LOG.debug("In CleanUp stale registered Gateways records ");
 | 
			
		||||
        try {
 | 
			
		||||
            // Get Equipment gateway list
 | 
			
		||||
            List<EquipmentGatewayRecord> eqGwRecList = eqRoutingSvc.getGateway(GatewayType.CEGW);
 | 
			
		||||
            if (eqGwRecList != null) {
 | 
			
		||||
@@ -432,6 +433,11 @@ public class OpensyncCloudGatewayController {
 | 
			
		||||
            } else {
 | 
			
		||||
                LOG.debug("No gateways registered with Routing Service");
 | 
			
		||||
            }
 | 
			
		||||
        } catch (Exception ex) { // Catching Exception to prevent crashing the register thread
 | 
			
		||||
            LOG.debug("Generic Exception encountered when trying to cleanup " +
 | 
			
		||||
                    "the stale not-reachable GateWays. Continuing to register the new Gateway." +
 | 
			
		||||
                    " Error: {} ", ex.getMessage());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private boolean isGwReachable(String ipAddr, int port) {
 | 
			
		||||
@@ -518,6 +524,7 @@ public class OpensyncCloudGatewayController {
 | 
			
		||||
     */
 | 
			
		||||
    protected void cleanupStaleEqptRoutingRecord(Long equipmentId) {
 | 
			
		||||
        LOG.debug("In Clean Up stale Equipment Routing record for Equipment ID {}", equipmentId);
 | 
			
		||||
        try {
 | 
			
		||||
            List<EquipmentRoutingRecord> eqptRoutingRecsList = eqRoutingSvc.getRegisteredRouteList(equipmentId);
 | 
			
		||||
            if (eqptRoutingRecsList != null) {
 | 
			
		||||
                for (EquipmentRoutingRecord eqRouting : eqptRoutingRecsList) {
 | 
			
		||||
@@ -538,16 +545,16 @@ public class OpensyncCloudGatewayController {
 | 
			
		||||
                    } catch (DsEntityNotFoundException entityNotFoundException) {
 | 
			
		||||
                        LOG.debug("Gateway ID: {} not found... Deleting the equipment routing entry", eqRouting.getGatewayId());
 | 
			
		||||
                        deleteUnresponiveGwRoutingRecord(eqRouting.getId(), equipmentId);
 | 
			
		||||
                } catch ( Exception genericException) {
 | 
			
		||||
                    LOG.debug("Generic Exception encountered when trying to query/delete " +
 | 
			
		||||
                            "the Gateway with ID: {}. Error: {} ", eqRouting.getGatewayId(), genericException.getMessage());
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
            } else {
 | 
			
		||||
                LOG.debug("No gateways registered with Routing Service for Equipment ID {}", equipmentId);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
        } catch (Exception genericException) { // Catching Exception to prevent crashing the register thread
 | 
			
		||||
            LOG.debug("Generic Exception encountered when trying to cleanup " +
 | 
			
		||||
                    "the stale routing records for equipment ID: {}. Continuing to register the new RoutingRecord." +
 | 
			
		||||
                    " Error: {} ", equipmentId, genericException.getMessage());
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private boolean deleteUnresponiveGwRoutingRecord(Long routingId, Long eqptId) {
 | 
			
		||||
 
 | 
			
		||||
@@ -24,23 +24,11 @@
 | 
			
		||||
			<artifactId>opensync-ext-cloud</artifactId>
 | 
			
		||||
			<version>${tip-wlan-cloud.release.version}</version>
 | 
			
		||||
		</dependency>
 | 
			
		||||
		<dependency>
 | 
			
		||||
			<artifactId>base-container</artifactId>
 | 
			
		||||
			<groupId>com.telecominfraproject.wlan</groupId>
 | 
			
		||||
			<version>${tip-wlan-cloud.release.version}</version>
 | 
			
		||||
		</dependency>
 | 
			
		||||
		<dependency>
 | 
			
		||||
			<artifactId>base-client</artifactId>
 | 
			
		||||
			<groupId>com.telecominfraproject.wlan</groupId>
 | 
			
		||||
			<version>${tip-wlan-cloud.release.version}</version>
 | 
			
		||||
		</dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <artifactId>filestore-service</artifactId>
 | 
			
		||||
            <groupId>com.telecominfraproject.wlan</groupId>
 | 
			
		||||
            <version>${tip-wlan-cloud.release.version}</version>
 | 
			
		||||
        </dependency>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		<dependency>
 | 
			
		||||
			<artifactId>customer-service-remote</artifactId>
 | 
			
		||||
			<groupId>com.telecominfraproject.wlan</groupId>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user