Uploaded image for project: 'ActiveMQ .Net'
  1. ActiveMQ .Net
  2. AMQNET-378

Collection modified exception in Connection.Close() when using temp destinations.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5.3
    • 1.5.4
    • None
    • None

    Description

      Collection Connection.tempDests is modified during enumeration and results in an exception and a failure to close connections.

      In Connection Close()

      foreach(ActiveMQTempDestination dest in this.tempDests.Values)
      {
          dest.Delete();
      }

      In ActiveMQTempDestination..

      public void Delete()
              {
                  if(this.connection != null)
                  {
                      this.connection.DeleteTemporaryDestination(this);
                  }
              }

      Connection.DeleteTemporaryDestination..

      public void DeleteTemporaryDestination(IDestination destination)
      		{
                  CheckClosedOrFailed();
      
                  ActiveMQTempDestination temp = destination as ActiveMQTempDestination;
      
                  foreach(Session session in this.sessions)
                  {
                      if(session.IsInUse(temp))
                      {
                          throw new NMSException("A consumer is consuming from the temporary destination");
                      }
                  }
      
                  this.tempDests.Remove(destination as ActiveMQTempDestination);
      			this.DeleteDestination(destination);
      		}

      Attachments

        Activity

          People

            jgomes Jim Gomes
            chillitom Tom
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h
                1h