0AyanamiRei commented on code in PR #57767:
URL: https://github.com/apache/doris/pull/57767#discussion_r2554568550
##########
be/src/runtime/load_channel_mgr.cpp:
##########
@@ -117,15 +117,36 @@ Status
LoadChannelMgr::_get_load_channel(std::shared_ptr<LoadChannel>& channel,
std::lock_guard<std::mutex> l(_lock);
auto it = _load_channels.find(load_id);
if (it == _load_channels.end()) {
- auto* handle = _last_success_channels->lookup(load_id.to_string());
- // success only when eos be true
+ Cache::Handle* handle =
_load_state_channels->lookup(load_id.to_string());
if (handle != nullptr) {
- _last_success_channels->release(handle);
- if (request.has_eos() && request.eos()) {
- is_eof = true;
- return Status::OK();
+ // load is cancelled
+ if (auto* value = _load_state_channels->value(handle); value !=
nullptr) {
+ const auto& cancel_reason =
reinterpret_cast<CacheValue*>(value)->_cancel_reason;
+ _load_state_channels->release(handle);
+ if (!cancel_reason.empty()) {
+ LOG(INFO) << fmt::format(
+ "The channel has been cancelled, load_id = {},
error = {}",
+ print_id(load_id), cancel_reason);
+ return Status::Cancelled(
+ "Load channel has been cancelled previously: {},
reason: {}",
+ load_id.to_string(), cancel_reason);
+ } else {
Review Comment:
this will be checked in "value != nullptr"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]