From 43bf4e4abe8caaad971d888ac13ebb62df7169c6 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 27 Nov 2024 14:43:24 +0100 Subject: [PATCH] [core] Report to Kafka source state if transition failed --- core/environment/environment.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/environment/environment.go b/core/environment/environment.go index 9a06d121..eca6cd8e 100644 --- a/core/environment/environment.go +++ b/core/environment/environment.go @@ -413,13 +413,15 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment, env.handlerFunc()(e) + eventState := e.Dst // we set the destination state here instead of the current for the event write, if the tasks have transitioned if e.Err != nil { errorMsg = e.Err.Error() + eventState = e.Src } the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{ EnvironmentId: env.id.String(), - State: e.Dst, // exceptionally we take the destination state here instead of the current, because the tasks have transitioned + State: eventState, RunNumber: env.currentRunNumber, Error: errorMsg, Message: "transition step finished",