-
Notifications
You must be signed in to change notification settings - Fork 23
[OCTRL-1016]: Missing runNumber in KafkaEvent on topic aliecs.run #705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
core/environment/environment.go
Outdated
| Debug("O2 End Completion time already set before after_GO_ERROR") | ||
| } | ||
| env.invalidateAutoStopTransition() | ||
| env.currentRunNumber = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
20 lines lower there is this:
if e.Event == "STOP_ACTIVITY" {
// If the event is STOP_ACTIVITY, we remove the active run number after all hooks are done.
env.workflow.GetVars().Set("last_run_number", strconv.Itoa(int(env.currentRunNumber)))
env.currentRunNumber = 0
env.workflow.GetVars().Del("run_number")
env.workflow.GetVars().Del("runNumber")
}
Shouldn't we just modify it so that it also deletes run numbers in case of GO_ERROR? We have to keep in mind though that GO_ERROR may not necessarily happen during RUNNING, but also in other states.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am suggesting this, because the GO_ERROR hooks with positive weights should still have access to run number.
4fa7f6b to
8aa10fd
Compare
|
We talked about multiple possibilities, but I kinda don't understand why just adding |
core/environment/environment.go
Outdated
| // If the event is STOP_ACTIVITY, we remove the active run number after all hooks are done. | ||
| if e.Event == "STOP_ACTIVITY" || e.Event == "GO_ERROR" { | ||
| // If the event is STOP_ACTIVITY or GO_ERROR, we remove the active run number after all hooks are done. | ||
| env.workflow.GetVars().Set("last_run_number", strconv.Itoa(int(env.currentRunNumber))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we should avoid setting "last_run_number" if env.currentRunNumber is 0. This could happen if we e.g. reach ERROR without ever starting a run.
This way, it will be less risky to have a bug due to some piece of code assuming that non-empty last_run_number means we had a run before.
I moved resetting of currentRunNumber from
StartActivityTransitionobject if some tasks fail to start toGO_ERRORtransition after message of EOEOR is send.@knopers8 Do you think that this can break something? Or do you propose something else?