Uploaded image for project: 'Common Controller SDK'
  1. Common Controller SDK
  2. CCSDK-1692

Kotlin ResourceResolution scripts dynamic compilation prevents redeploying CBA

    XMLWordPrintable

    Details

      Description

      The dynamic compilation an loading of kotlin script prevents the reloading of the same cba, since the classloader hold on to the folder where the jar was produced. 

      This makes the features pretty much unusable during development as it requires a CDS reboot to be able to redeploy a CBA. 

      It seems the compilation happens in a different folder than cleanup : 

      During compile/classloading : 
      13:58:45.378 [reactor-http-epoll-4] INFO o.o.c.c.c.core.scripts.BluePrintClassLoader - loading compiled cache(/opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1)
       
      During cleanup in cba redeploy:
      14:00:06.171 [reactor-http-epoll-2] WARN o.o.c.c.c.core.scripts.BluePrintCompileCache - No compiled cache(/opt/app/onap/blueprints/working/b221aa72-706b-418e-9a16-41e85
      e9cac2c) present to clean.

       
      I changed the code to try to cleanup at the right place an it does, but still holds lock on the folder hosting the jar :
       
      14:00:06.174 [reactor-http-epoll-2] INFO o.o.c.c.c.core.scripts.BluePrintCompileCache - Cleaned compiled cache(/opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1)
      /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Scripts/kotlin not empty
      /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Scripts not empty
      /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1 not empty
       
      I changed the cleanup code in BlueprintProcessorCatalogServiceImpl to make it more explicit:
       
      cds-backend | 14:00:11.321 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleted- file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Scripts/kotlin/PnfIps.kt
      cds-backend | 14:00:11.324 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleting file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Scripts/kotlin/stream5-bgp-1.0.1-cba-kts.jar
      cds-backend | 14:00:11.325 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleted- file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Scripts/kotlin/stream5-bgp-1.0.1-cba-kts.jar
      cds-backend | 14:00:11.326 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleting file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Scripts/kotlin
      cds-backend | /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Scripts/kotlin not empty
      cds-backend | 14:00:11.331 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleting file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Scripts/python/Commit.py
      cds-backend | 14:00:11.332 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleted- file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Scripts/python/Commit.py
      cds-backend | 14:00:11.332 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleting file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Scripts/python
      cds-backend | 14:00:11.334 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleted- file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Scripts/python
      cds-backend | 14:00:11.334 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleting file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Scripts
      cds-backend | /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Scripts not empty
      cds-backend | 14:00:11.342 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleting file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Templates/bgp-day0-mapping.json
      cds-backend | 14:00:11.344 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleted- file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Templates/bgp-day0-mapping.json
      cds-backend | 14:00:11.346 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleting file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Templates/bgp-day0-template.vtl
      cds-backend | 14:00:11.349 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleted- file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Templates/bgp-day0-template.vtl
      cds-backend | 14:00:11.351 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleting file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Templates/isis-mapping.json
      cds-backend | 14:00:11.352 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleted- file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Templates/isis-mapping.json
      cds-backend | 14:00:11.354 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleting file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Templates/isis-template.j2
      cds-backend | 14:00:11.355 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleted- file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Templates/isis-template.j2
      cds-backend | 14:00:11.355 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleting file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Templates
      cds-backend | 14:00:11.358 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleted- file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Templates
      cds-backend | 14:00:11.361 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleting file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Tests/cba-tests.http
      cds-backend | 14:00:11.362 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleted- file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Tests/cba-tests.http
      cds-backend | 14:00:11.364 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleting file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Tests/pre-requisites.http
      cds-backend | 14:00:11.365 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleted- file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Tests/pre-requisites.http
      cds-backend | 14:00:11.365 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleting file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Tests
      cds-backend | 14:00:11.367 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleted- file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/Tests
      cds-backend | 14:00:11.371 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleting file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/TOSCA-Metadata/TOSCA.meta
      cds-backend | 14:00:11.373 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleted- file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/TOSCA-Metadata/TOSCA.meta
      cds-backend | 14:00:11.373 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleting file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/TOSCA-Metadata
      cds-backend | 14:00:11.376 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleted- file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/TOSCA-Metadata
      cds-backend | 14:00:11.376 [reactor-http-epoll-2] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - Deleting file/dir /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1
      cds-backend | /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1 not empty
      cds-backend | 14:00:11.688 [reactor-http-epoll-2] WARN o.o.c.c.c.core.scripts.BluePrintCompileCache - No compiled cache(/opt/app/onap/blueprints/working/b221aa72-706b-418e-9a16-41e85e9cac2c) present to clean.
      cds-backend | 14:00:18.478 [reactor-http-epoll-3] INFO c.o.c.c.b.selfservice.api.ExecutionServiceHandler - processing request id 123456
      cds-backend | 14:00:18.484 [reactor-http-epoll-3] INFO c.o.c.c.b.db.BlueprintProcessorCatalogServiceImpl - cba file name(stream5-bgp), version(1.0.1) already present(/opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1)
      cds-backend | 14:00:18.484 [reactor-http-epoll-3] INFO c.o.c.c.b.selfservice.api.ExecutionServiceHandler - blueprint base path /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1
      cds-backend | 14:00:18.490 [reactor-http-epoll-3] ERROR c.o.c.c.b.selfservice.api.ExecutionServiceHandler - fail processing request id 123456
      cds-backend | java.io.FileNotFoundException: /opt/app/onap/blueprints/deploy/stream5-bgp/1.0.1/TOSCA-Metadata/TOSCA.meta (No such file or directory)
      cds-backend | at java.io.FileInputStream.open0(Native Method)
      cds-backend | at java.io.FileInputStream.open(FileInputStream.java:195)
      cds-backend | at java.io.FileInputStream.(FileInputStream.java:138)
      cds-backend | at kotlin.io.FilesKt__FileReadWriteKt.forEachLine(FileReadWrite.kt:166)
      cds-backend | at kotlin.io.FilesKt__FileReadWriteKt.readLines(FileReadWrite.kt:195)
      cds-backend | at org.onap.ccsdk.cds.controllerblueprints.core.FileExtensionFunctionsKt$readNBLines$2.invokeSuspend(FileExtensionFunctions.kt:107)
      cds-backend | at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
      cds-backend | at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:238)
      cds-backend | at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
      cds-backend | at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
      cds-backend | at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:742)

       

        Attachments

          Activity

            People

            Assignee:
            djtimoney Dan Timoney
            Reporter:
            agileone Serge Simard
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: