Uploaded image for project: 'netvirt'
  1. netvirt
  2. NETVIRT-1075

NeutronvpnUtils: handle transactions with jobCoordinator to avoid blocking

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Medium Medium
    • Magnesium
    • None
    • None
    • None

      Now we are using  in NeutronvpnUtils: updateVpnInstanceOpWithType  blocking transaction:

      VpnInstanceOpDataEntryBuilder builder = new VpnInstanceOpDataEntryBuilder(vpnInstanceOpDataEntry);
      builder.setBgpvpnType(choice);
      WriteTransaction writeTxn = dataBroker.newWriteOnlyTransaction();
      writeTxn.merge(LogicalDatastoreType.OPERATIONAL, id, builder.build(), false);
      LOG.debug("updateVpnInstanceOpWithType: sent merge to operDS BgpvpnType {} for {}", choice, vpn.getValue());
      try {
           writeTxn.submit().get();

      ....

      And the same in some other methods.

      It will be better to refactor NeutronvpnUtils, and to use async transactions handeled by jobCoordinator as much as possible, to avoid blocking

      https://git.opendaylight.org/gerrit/#/c/57411/153/vpnservice/neutronvpn/neutronvpn-impl/src/main/java/org/opendaylight/netvirt/neutronvpn/NeutronvpnUtils.java@1627

       

            valentina.krasnobaeva Valentina Krasnobaeva
            valentina.krasnobaeva Valentina Krasnobaeva
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: