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

The wrong lock used when destroy IndexService

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.0-incubating, 4.1.0-incubating
    • Fix Version/s: 4.2.0
    • Component/s: build
    • Labels:
      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

            • Assignee:
              Yukon yukon
              Reporter:
              Yukon yukon
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: