Skip to content

Commit 43bf4e4

Browse files
committed
[core] Report to Kafka source state if transition failed
1 parent 2d35bd2 commit 43bf4e4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/environment/environment.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,13 +413,15 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment,
413413

414414
env.handlerFunc()(e)
415415

416+
eventState := e.Dst // we set the destination state here instead of the current for the event write, if the tasks have transitioned
416417
if e.Err != nil {
417418
errorMsg = e.Err.Error()
419+
eventState = e.Src
418420
}
419421

420422
the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{
421423
EnvironmentId: env.id.String(),
422-
State: e.Dst, // exceptionally we take the destination state here instead of the current, because the tasks have transitioned
424+
State: eventState,
423425
RunNumber: env.currentRunNumber,
424426
Error: errorMsg,
425427
Message: "transition step finished",

0 commit comments

Comments
 (0)