This is an automated email from the ASF dual-hosted git repository.
gavinchou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new b9fb461843d [opt](s3filewriter) Optimize exception handling when put
object (#43809)
b9fb461843d is described below
commit b9fb461843d2bab769c64d1658d4d452fdd1ddb9
Author: Gavin Chou <[email protected]>
AuthorDate: Thu Nov 14 16:26:39 2024 +0800
[opt](s3filewriter) Optimize exception handling when put object (#43809)
we should not continue to put object if state is not satisfied.
---
be/src/io/fs/s3_file_writer.cpp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/be/src/io/fs/s3_file_writer.cpp b/be/src/io/fs/s3_file_writer.cpp
index e40b9e171eb..7a06ce22074 100644
--- a/be/src/io/fs/s3_file_writer.cpp
+++ b/be/src/io/fs/s3_file_writer.cpp
@@ -379,7 +379,14 @@ Status
S3FileWriter::_set_upload_to_remote_less_than_buffer_size() {
}
void S3FileWriter::_put_object(UploadFileBuffer& buf) {
- DCHECK(state() != State::CLOSED) << fmt::format("state is {}", state());
+ if (state() == State::CLOSED) {
+ DCHECK(state() != State::CLOSED)
+ << "state=" << (int)state() << " path=" <<
_obj_storage_path_opts.path.native();
+ LOG_WARNING("failed to put object because file closed, file path {}",
+ _obj_storage_path_opts.path.native());
+ buf.set_status(Status::InternalError<false>("try to put closed file"));
+ return;
+ }
const auto& client = _obj_client->get();
if (nullptr == client) {
buf.set_status(Status::InternalError<false>("invalid obj storage
client"));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]