@@ -515,22 +515,6 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
515
515
RuntimeSettings.TerminateHandler (success, issues);
516
516
}
517
517
518
- // Send final state to executer to inform about termination.
519
- if (!success) {
520
- auto ev = MakeHolder<TEvDqCompute::TEvState>();
521
- auto & record = ev->Record ;
522
-
523
- if (RuntimeSettings.StatsMode >= NDqProto::DQ_STATS_MODE_BASIC) {
524
- FillStats (record.MutableStats (), /* last */ true );
525
- }
526
-
527
- record.SetState (NDqProto::COMPUTE_STATE_FINISHED);
528
- record.SetStatusCode (NDqProto::StatusIds::ABORTED);
529
- record.SetTaskId (Task.GetId ());
530
-
531
- this ->Send (ExecuterId, ev.Release ());
532
- }
533
-
534
518
this ->PassAway ();
535
519
Terminated = true ;
536
520
}
@@ -570,7 +554,7 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
570
554
}
571
555
}
572
556
573
- void ReportStateAndMaybeDie (NYql::NDqProto::StatusIds::StatusCode statusCode, const TIssues& issues)
557
+ void ReportStateAndMaybeDie (NYql::NDqProto::StatusIds::StatusCode statusCode, const TIssues& issues, bool forceTerminate = false )
574
558
{
575
559
auto execEv = MakeHolder<TEvDqCompute::TEvState>();
576
560
auto & record = execEv->Record ;
@@ -591,7 +575,7 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
591
575
592
576
this ->Send (ExecuterId, execEv.Release ());
593
577
594
- if (Checkpoints && State == NDqProto::COMPUTE_STATE_FINISHED) {
578
+ if (!forceTerminate && Checkpoints && State == NDqProto::COMPUTE_STATE_FINISHED) {
595
579
// checkpointed CAs must not self-destroy
596
580
return ;
597
581
}
@@ -1048,10 +1032,6 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
1048
1032
auto tag = (EEvWakeupTag) ev->Get ()->Tag ;
1049
1033
switch (tag) {
1050
1034
case EEvWakeupTag::TimeoutTag: {
1051
- auto abortEv = MakeHolder<TEvDq::TEvAbortExecution>(NYql::NDqProto::StatusIds::TIMEOUT, TStringBuilder ()
1052
- << " Timeout event from compute actor " << this ->SelfId ()
1053
- << " , TxId: " << TxId << " , task: " << Task.GetId ());
1054
-
1055
1035
if (ComputeActorSpan) {
1056
1036
ComputeActorSpan.EndError (
1057
1037
TStringBuilder ()
@@ -1060,10 +1040,8 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
1060
1040
);
1061
1041
}
1062
1042
1063
- this ->Send (ExecuterId, abortEv.Release ());
1064
-
1065
- TerminateSources (" timeout exceeded" , false );
1066
- Terminate (false , " timeout exceeded" );
1043
+ State = NDqProto::COMPUTE_STATE_FAILURE;
1044
+ ReportStateAndMaybeDie (NYql::NDqProto::StatusIds::TIMEOUT, {TIssue (" timeout exceeded" )}, true );
1067
1045
break ;
1068
1046
}
1069
1047
case EEvWakeupTag::PeriodicStatsTag: {
@@ -1087,8 +1065,9 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
1087
1065
switch (lostEventType) {
1088
1066
case TEvDqCompute::TEvState::EventType: {
1089
1067
CA_LOG_E (" Handle undelivered TEvState event, abort execution" );
1090
- this ->TerminateSources (" executer lost" , false );
1091
- Terminate (false , " executer lost" );
1068
+
1069
+ TerminateSources (" executer lost" , false );
1070
+ Terminate (false , " executer lost" ); // Executer lost - no need to report state
1092
1071
break ;
1093
1072
}
1094
1073
default : {
@@ -1134,14 +1113,17 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
1134
1113
InternalError (NYql::NDqProto::StatusIds::INTERNAL_ERROR, *ev->Get ()->GetIssues ().begin ());
1135
1114
return ;
1136
1115
}
1116
+
1137
1117
TIssues issues = ev->Get ()->GetIssues ();
1138
1118
CA_LOG_E (" Handle abort execution event from: " << ev->Sender
1139
1119
<< " , status: " << NYql::NDqProto::StatusIds_StatusCode_Name (ev->Get ()->Record .GetStatusCode ())
1140
1120
<< " , reason: " << issues.ToOneLineString ());
1141
1121
1142
- bool success = ev->Get ()->Record .GetStatusCode () == NYql::NDqProto::StatusIds::SUCCESS;
1143
-
1144
- this ->TerminateSources (issues, success);
1122
+ if (ev->Get ()->Record .GetStatusCode () == NYql::NDqProto::StatusIds::SUCCESS) {
1123
+ State = NDqProto::COMPUTE_STATE_FINISHED;
1124
+ } else {
1125
+ State = NDqProto::COMPUTE_STATE_FAILURE;
1126
+ }
1145
1127
1146
1128
if (ev->Sender != ExecuterId) {
1147
1129
if (ComputeActorSpan) {
@@ -1151,7 +1133,7 @@ class TDqComputeActorBase : public NActors::TActorBootstrapped<TDerived>
1151
1133
NActors::TActivationContext::Send (ev->Forward (ExecuterId));
1152
1134
}
1153
1135
1154
- Terminate (success , issues);
1136
+ ReportStateAndMaybeDie (ev-> Get ()-> Record . GetStatusCode () , issues, true );
1155
1137
}
1156
1138
1157
1139
void HandleExecuteBase (NActors::TEvInterconnect::TEvNodeDisconnected::TPtr& ev) {
0 commit comments