[fix](hdfs-writer) Catch error information after hdfsCloseFile() (#33195)
This commit is contained in:
@ -64,8 +64,15 @@ Status HdfsFileWriter::close() {
|
||||
LOG(WARNING) << ss.str();
|
||||
return Status::InternalError(ss.str());
|
||||
}
|
||||
hdfsCloseFile(_hdfs_fs->_fs_handle->hdfs_fs, _hdfs_file);
|
||||
|
||||
result = hdfsCloseFile(_hdfs_fs->_fs_handle->hdfs_fs, _hdfs_file);
|
||||
_hdfs_file = nullptr;
|
||||
if (result != 0) {
|
||||
std::string err_msg = hdfs_error();
|
||||
return Status::InternalError(
|
||||
"Write hdfs file failed. (BE: {}) namenode:{}, path:{}, err: {}",
|
||||
BackendOptions::get_localhost(), _hdfs_fs->_fs_name, _path.string(), err_msg);
|
||||
}
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user