yukon created ROCKETMQ-260:
------------------------------

             Summary: The wrong lock used when destroy IndexService
                 Key: ROCKETMQ-260
                 URL: https://issues.apache.org/jira/browse/ROCKETMQ-260
             Project: Apache RocketMQ
          Issue Type: Bug
          Components: build
    Affects Versions: 4.1.0-incubating, 4.0.0-incubating
            Reporter: yukon
            Assignee: yukon
             Fix For: 4.2.0-incubating


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

{code}
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();
        }
    }
{code} 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to