Skip to content

Conversation

@justonedev1
Copy link
Collaborator

I moved resetting of currentRunNumber from StartActivityTransition object if some tasks fail to start to GO_ERROR transition after message of EOEOR is send.

@knopers8 Do you think that this can break something? Or do you propose something else?

@justonedev1 justonedev1 requested a review from knopers8 as a code owner May 8, 2025 13:35
Debug("O2 End Completion time already set before after_GO_ERROR")
}
env.invalidateAutoStopTransition()
env.currentRunNumber = 0
Copy link
Collaborator

@knopers8 knopers8 May 8, 2025

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.

Copy link
Collaborator

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.

@justonedev1 justonedev1 force-pushed the OCTRL-1016 branch 2 times, most recently from 4fa7f6b to 8aa10fd Compare May 13, 2025 09:11
@justonedev1 justonedev1 requested a review from knopers8 May 13, 2025 09:12
@justonedev1
Copy link
Collaborator Author

We talked about multiple possibilities, but I kinda don't understand why just adding GO_ERROR isn't enough here, it should happen after all hooks are handled.

// 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)))
Copy link
Collaborator

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.

@knopers8 knopers8 merged commit 7b43fb6 into master May 13, 2025
0 of 2 checks passed
@knopers8 knopers8 deleted the OCTRL-1016 branch May 13, 2025 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants