Uploaded image for project: 'Configuration Persistence Service'
  1. Configuration Persistence Service
  2. CPS-466

Concurrent requests to create schema sets for the same yang model are not supported

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • Istanbul Release
    • Istanbul Release
    • CPS-Core
    • None

      Expected behaviour:

      • Concurrent requests to create schema sets for the same yang model are handled in the same way the same requests sent sequentially are.

      Actual behaviour:

      • Some concurrent requests might fail with Internal Server Error

      Steps to reproduce:

      1. Create a dataspace:

      curl -X POST 'http://localhost:8080/cps/api/v1/dataspaces?dataspace-name=bsa-dataspace-7' \-H 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE='
      

      2. Create 2 schema sets concurrently with attached bookstore.yang  (ensure that yang resources does not exist yet for this model)

      curl -X POST 'http://localhost:8080/cps/api/v1/dataspaces/bsa-dataspace-7/schema-sets' \
      -H 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE=' \
      -F 'file=@"bookstore.yang"' \
      -F 'schema-set-name="bsa-schema-set-1"' & \
      curl -X POST 'http://localhost:8080/cps/api/v1/dataspaces/bsa-dataspace-7/schema-sets' \
      -H 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE=' \
      -F 'file=@"bookstore.yang"' \
      -F 'schema-set-name="bsa-schema-set-2"'
      

      Then, http response for one of the 2 requests could be:

      {
        "status":"500 INTERNAL_SERVER_ERROR",
        "message":"could not execute statement; SQL [n/a]; constraint [yang_resource_checksum_key]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement",
        "details":"Check logs for details."
      }

      See error.log for the logs

       

       

       

        1. bookstore.yang
          0.9 kB
        2. error.log
          41 kB

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

              Created:
              Updated:
              Resolved: