Ye Zihao created IMPALA-11998:
---------------------------------

             Summary: The iterator provided by ImpalaServer::GetQueryRecord() 
may become invalid
                 Key: IMPALA-11998
                 URL: https://issues.apache.org/jira/browse/IMPALA-11998
             Project: IMPALA
          Issue Type: Bug
          Components: be
    Affects Versions: Impala 4.2.0
            Reporter: Ye Zihao
            Assignee: Ye Zihao


{code:c++}
Status ImpalaServer::GetQueryRecord(const TUniqueId& query_id,
    QueryLogIndex::const_iterator* query_record) {
  lock_guard<mutex> l(query_log_lock_);
  *query_record = query_log_index_.find(query_id); 
  ...
  return Status::OK();
}
{code}

This may cause the caller to access invalid iterators, although the function 
locks query_log_lock_ in the execution, the query_record it provides cannot 
guarantee to be valid, because it is out of the protection of query_log_lock_ 
after returning, if query_log_index_ just deletes the corresponding record at 
this time, then query_record will be an invalid iterator.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to