[ 
https://issues.apache.org/jira/browse/IMPALA-5587?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tim Armstrong resolved IMPALA-5587.
-----------------------------------
       Resolution: Fixed
    Fix Version/s: Impala 2.13.0

I couldn't find any remaining examples of this pattern.

> ReleaseResources() should not destroy control structures
> --------------------------------------------------------
>
>                 Key: IMPALA-5587
>                 URL: https://issues.apache.org/jira/browse/IMPALA-5587
>             Project: IMPALA
>          Issue Type: Sub-task
>          Components: Backend
>            Reporter: Dan Hecht
>            Priority: Major
>              Labels: query-lifecycle
>             Fix For: Impala 2.13.0
>
>
> For example:
> {code:title=RuntimeState::ReleaseResources()}
> void RuntimeState::ReleaseResources() {
>   UnregisterReaderContexts();
>   if (filter_bank_ != nullptr) filter_bank_->Close();
>   if (resource_pool_ != nullptr) {
>     exec_env_->thread_mgr()->UnregisterPool(resource_pool_);
>   }
>   block_mgr_.reset(); // Release any block mgr memory, if this is the last 
> reference.
>   codegen_.reset(); // Release any memory associated with codegen.
>   // Release the reservation, which should be unused at the point.
>   if (instance_buffer_reservation_ != nullptr) 
> instance_buffer_reservation_->Close();
>   // 'query_mem_tracker()' must be valid as long as 'instance_mem_tracker_' 
> is so
>   // delete 'instance_mem_tracker_' first.
>   // LogUsage() walks the MemTracker tree top-down when the memory limit is 
> exceeded, so
>   // break the link between 'instance_mem_tracker_' and its parent before
>   // 'instance_mem_tracker_' and its children are destroyed.
>   instance_mem_tracker_->UnregisterFromParent();   <=======
>   if (instance_mem_tracker_->consumption() != 0) {
>     LOG(WARNING) << "Query " << query_id() << " may have leaked memory." << 
> endl
>                  << instance_mem_tracker_->LogUsage();
>   }
>   instance_mem_tracker_.reset();                                 <=======
>   if (local_query_state_.get() != nullptr) {
>     // if we created this QueryState, we must call ReleaseResources()
>     local_query_state_->ReleaseResources();
>   }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscr...@impala.apache.org
For additional commands, e-mail: issues-all-h...@impala.apache.org

Reply via email to