This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
commit fd6ec9773128c10923e5d11c5fda0458351ff652 Author: Kaijie Chen <c...@apache.org> AuthorDate: Fri Jan 19 10:44:03 2024 +0800 [fix](injection) don't disturb CLOSE_LOAD message in LoadStream (#30097) --- be/src/runtime/load_stream.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/be/src/runtime/load_stream.cpp b/be/src/runtime/load_stream.cpp index efffa23e650..7d494eba88a 100644 --- a/be/src/runtime/load_stream.cpp +++ b/be/src/runtime/load_stream.cpp @@ -521,15 +521,19 @@ int LoadStream::on_received_messages(StreamId id, butil::IOBuf* const messages[] void LoadStream::_dispatch(StreamId id, const PStreamHeader& hdr, butil::IOBuf* data) { VLOG_DEBUG << PStreamHeader_Opcode_Name(hdr.opcode()) << " from " << hdr.src_id() << " with tablet " << hdr.tablet_id(); - DBUG_EXECUTE_IF("LoadStream._dispatch.unknown_loadid", { - PUniqueId& load_id = const_cast<PUniqueId&>(hdr.load_id()); - load_id.set_hi(UNKNOWN_ID_FOR_TEST); - load_id.set_lo(UNKNOWN_ID_FOR_TEST); - }); - DBUG_EXECUTE_IF("LoadStream._dispatch.unknown_srcid", { - PStreamHeader& t_hdr = const_cast<PStreamHeader&>(hdr); - t_hdr.set_src_id(UNKNOWN_ID_FOR_TEST); - }); + // CLOSE_LOAD message should not be fault injected, + // otherwise the message will be ignored and causing close wait timeout + if (hdr.opcode() != PStreamHeader::CLOSE_LOAD) { + DBUG_EXECUTE_IF("LoadStream._dispatch.unknown_loadid", { + PUniqueId& load_id = const_cast<PUniqueId&>(hdr.load_id()); + load_id.set_hi(UNKNOWN_ID_FOR_TEST); + load_id.set_lo(UNKNOWN_ID_FOR_TEST); + }); + DBUG_EXECUTE_IF("LoadStream._dispatch.unknown_srcid", { + PStreamHeader& t_hdr = const_cast<PStreamHeader&>(hdr); + t_hdr.set_src_id(UNKNOWN_ID_FOR_TEST); + }); + } if (UniqueId(hdr.load_id()) != UniqueId(_load_id)) { Status st = Status::Error<ErrorCode::INVALID_ARGUMENT>( "invalid load id {}, expected {}", print_id(hdr.load_id()), print_id(_load_id)); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org