| 342 | } |
| 343 | |
| 344 | void RuntimeState::ReleaseResources() { |
| 345 | DCHECK(!released_resources_); |
| 346 | if (resource_pool_ != nullptr) { |
| 347 | ExecEnv::GetInstance()->thread_mgr()->DestroyPool(move(resource_pool_)); |
| 348 | } |
| 349 | // Release the reservation, which should be unused at the point. |
| 350 | if (instance_buffer_reservation_ != nullptr) instance_buffer_reservation_->Close(); |
| 351 | |
| 352 | // No more memory should be tracked for this instance at this point. |
| 353 | if (instance_mem_tracker_->consumption() != 0) { |
| 354 | LOG(WARNING) << "Query " << PrintId(query_id()) << " may have leaked memory." << endl |
| 355 | << instance_mem_tracker_->LogUsage(MemTracker::UNLIMITED_DEPTH); |
| 356 | } |
| 357 | instance_mem_tracker_->Close(); |
| 358 | |
| 359 | if (local_query_state_.get() != nullptr) { |
| 360 | local_query_state_->ReleaseBackendResourceRefcount(); |
| 361 | } |
| 362 | released_resources_ = true; |
| 363 | } |
| 364 | |
| 365 | void RuntimeState::SetRPCErrorInfo(NetworkAddressPB dest_node, int16_t posix_error_code) { |
| 366 | std::lock_guard<SpinLock> l(aux_error_info_lock_); |
nothing calls this directly
no test coverage detected