Uploaded image for project: 'ONOS'
  1. ONOS
  2. ONOS-3079

Link Resource Manager - problems in simultaneous requests for allocate/release of resources

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 1.3.0, 1.4.0
    • Fix Version/s: 1.5.0
    • Component/s: None
    • Labels:
      None

      Description

      As part of our development of ODU Cross-Connect Service we plan to add a new Link Resource of ODU-TribSlots, using the same existing APIs of LinkResourceManager (i.e. similar to MPLS_LABEL and LAMBDA resources).

      During our testings we noticed that all Link Resource Management works just fine if Link resources are allocated/released for a single Intent at a time, i.e. when Intent is compiled for the first time, or when it is re-compiled due to topology changes.

      However, in cases where more than one intent is compiled simultaneously (e.g. intents are recompiled due to change in Link state to down), there are concurrency issues.
      In these cases we noticed that when there are several requests for resources on the same Links, the same resource is allocated to both intents!!!
      This problem is due to the fact that there are no locks/sync mechanism either in the manager or in the store. So basically all the tests/validations on a free resource may pass depending on the threads timing.

      The problem occurs in the following scenario:

      • when allocateResources (in ConsistentLinkResourceStore) is called simultaneously for several Intents with request for the same allocations, and
      • the transaction commit (of one request) is not performed prior to the calculation of available resources on the Link (by the other requests).
        In this case: several requests might result with the same available resources and, and therefore the same resource will be allocated by several Intents.

      Note that the existing check of “Concurrent Allocation” in method allocateLinkResource (in ConsistentLinkResourceStore) –
      sometimes indeed catches the wrong attempt to allocate the same resource simultaneously, but not always !!!. (It depends whether the commit() was applied already or not).

      As a workaround to resolve the problem, I added “synchronized” to the LinkResourceManager APIs, :

      • public synchronized LinkResourceAllocations requestResources(LinkResourceRequest req) { …}

        - public synchronized void releaseResources(LinkResourceAllocations allocations) { …}

      As I understand there is a work on a "new resource manager". Are these concurrency issues planned to be handled in the new implementation?
      Meanwhile, should we add the "synchronized" or do you suggest another solution?

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            shimizu Shimizu Sho
            Reporter:
            an7562 Aliza Nagauker
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: