Uploaded image for project: 'Fabric'
  1. Fabric
  2. FAB-16980

deliverServiceImpl#UpdateEndpoints does not take a lock

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Medium
    • Resolution: Done
    • v1.4.3
    • v1.4.4
    • fabric-peer
    • None
    • (Please add steps to reproduce)

    Description

      The deliverServiceImpl#UpdateEndpoints method neglects to take a lock when accessing the d.deliverClients map.

      Other methods take d.lock when accessing d.deliverClients.

       

      From fabric/core/deliveryservice/deliveryclient.go

       

      func (d *deliverServiceImpl) UpdateEndpoints(chainID string, connCriteria ConnectionCriteria) error {
          // Use chainID to obtain blocks provider and pass endpoints
          // for update
          if dc, ok := d.deliverClients[chainID]; ok

      {         // We have found specified channel so we can safely update it         dc.bclient.UpdateEndpoints(connCriteria.toEndpointCriteria())         return nil     }

          return errors.New(fmt.Sprintf("Channel with %s id was not found", chainID))
      }

      Attachments

        Activity

          People

            tock Yoav Tock
            tock Yoav Tock
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: