262707 {
262709 if (!cc) {
262710 return StreamExecutionResult::EXECUTION_CANCELLED;
262711 }
262712 if (!cc->IsActiveResult(context_lock, result)) {
262713 return StreamExecutionResult::EXECUTION_CANCELLED;
262714 }
262715
262716
262717 if (cc->interrupted.load(std::memory_order_relaxed)) {
262718 throw InterruptException();
262719 }
262720 if (BufferIsFull()) {
262721
262722 return StreamExecutionResult::CHUNK_READY;
262723 }
262724 UnblockSinks();
262725
262726 auto execution_result = cc->ExecuteTaskInternal(context_lock, result);
262728 return StreamExecutionResult::CHUNK_READY;
262729 }
262730 if (execution_result == PendingExecutionResult::BLOCKED ||
262731 execution_result == PendingExecutionResult::RESULT_READY) {
262732 return StreamExecutionResult::BLOCKED;
262733 }
262734 if (result.HasError()) {
262735 Close();
262736 }
262737 switch (execution_result) {
262738 case PendingExecutionResult::NO_TASKS_AVAILABLE:
262739 case PendingExecutionResult::RESULT_NOT_READY:
262740 return StreamExecutionResult::CHUNK_NOT_READY;
262741 case PendingExecutionResult::EXECUTION_FINISHED:
262742 return StreamExecutionResult::EXECUTION_FINISHED;
262743 case PendingExecutionResult::EXECUTION_ERROR:
262744 return StreamExecutionResult::EXECUTION_ERROR;
262745 default:
262746 throw InternalException("No conversion from PendingExecutionResult (%s) -> StreamExecutionResult",
262747 EnumUtil::ToString(execution_result));
262748 }
262749}