Uploaded image for project: 'Apache RocketMQ'
  1. Apache RocketMQ
  2. ROCKETMQ-260

The wrong lock used when destroy IndexService

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0.0-incubating, 4.1.0-incubating
    • 4.2.0
    • build
    • None

    Description

      When destroy IndexService, the indexFileList should be cleared with write lock guarantee, but destroy method uses read lock insted.

      public void destroy() {
              try {
                  this.readWriteLock.readLock().lock();
                  for (IndexFile f : this.indexFileList) {
                      f.destroy(1000 * 3);
                  }
                  this.indexFileList.clear();
              } catch (Exception e) {
                  log.error("destroy exception", e);
              } finally {
                  this.readWriteLock.readLock().unlock();
              }
          }
      

      Attachments

        Activity

          People

            yukon Xinyu Zhou
            yukon Xinyu Zhou
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: