Skip to content

The program has bug when the steps in a stage are set to concurrent #12

@liuchenailq

Description

@liuchenailq

When I set up concurrent execution for the steps of a stage, I find that program always execute the last step.
Looking at the source code, I found closure functions used for concurrent execution, which I guess is where the bug came from.

// file  stage.go
for _, step := range st.Steps {
			step.Status("begin")
			g.run(func() *Result {

				defer step.Status("end")

				//disables strict mode. g.run will wait for all steps to finish
				if st.DisableStrictMode {
					return step.Exec(request)
				}
				fmt.Println(step.getCtx().index, step.getCtx().name)
				resultChan := make(chan *Result, 1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions