Skip to content

Commit

Permalink
[fix](cloud) fix double free when get_error_log_file_path
Browse files Browse the repository at this point in the history
  • Loading branch information
liaoxin01 committed Sep 26, 2024
1 parent 16d05dc commit 4e3371a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions be/src/runtime/runtime_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ Status RuntimeState::append_error_msg_to_file(std::function<std::string()> line,
}

std::string RuntimeState::get_error_log_file_path() {
std::lock_guard<std::mutex> l(_s3_error_log_file_lock);
if (_s3_error_fs && _error_log_file && _error_log_file->is_open()) {
// close error log file
_error_log_file->close();
Expand Down
1 change: 1 addition & 0 deletions be/src/runtime/runtime_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ class RuntimeState {
std::shared_ptr<io::S3FileSystem> _s3_error_fs;
// error file path on s3, ${bucket}/${prefix}/error_log/${label}_${fragment_instance_id}
std::string _s3_error_log_file_path;
std::mutex _s3_error_log_file_lock;
};

#define RETURN_IF_CANCELLED(state) \
Expand Down

0 comments on commit 4e3371a

Please sign in to comment.