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

NoClassDefFoundError when executing parallel kotlin script

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • Honolulu Release
    • Frankfurt Release
    • cds

      See attached logs for more detail about the exception : cds.log

      How to reproduce :

      Use this CBA : cba.zip

      Set USE_SCRIPT_COMPILE_CACHE to false

       

      USE_SCRIPT_COMPILE_CACHE set to false cleans the Class Loader cache after each kotlin script execution. When several kotlin script are executed in parallel (ie no dependency between them) and USE_SCRIPT_COMPILE_CACHE=false then the class loader from the cache may be deleted before one of those executed kotlin script get the time to finish which to the NoClassDefFoundError.

      Removed cleanupInstance method for kotlin script executors that where causing the class loader to be removed prematurely. Now the behaviour is to remove the class loader from the cache only when we publish a new CBA which was already the case when CDS run with a single instance. In cluster mode, a topic has been added to hazelcast to allow the instance publishing the updated CBA to communicate to the other instances by sending a message to clean the class loader for this CBA from their cache.

      Added mutex on kotlin script compilation to fix race condition. For concurrent kotlin script execution each process wanted to compile an executable but it was causing a race condition if a process tries to execute while another still compile. Mutex on the execution path prevent this behaviour.

      See following file for kotlin compilation race condition : compile.log

        1. cba.zip
          163 kB
        2. cds.log
          77 kB
        3. compile.log
          3 kB

            jfontaine49 jfontaine49
            jfontaine49 jfontaine49
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: