Skip to content
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

jx-build-controller should not block on log gathering #8114

Open
JordanGoasdoue opened this issue Mar 31, 2022 · 2 comments
Open

jx-build-controller should not block on log gathering #8114

JordanGoasdoue opened this issue Mar 31, 2022 · 2 comments

Comments

@JordanGoasdoue
Copy link

jx-build-controller is stuck on "logging pod" from here https://github.com/jenkins-x-plugins/jx-build-controller/blob/35b904eeb00de306120975c6e0408cb2d4268c6b/pkg/cmd/controller/tekton/tekton.go#L361

This is this function from jx-pipeline: https://github.com/jenkins-x-plugins/jx-pipeline/blob/76d8eb75c20e614f0759160bf25481ff9dcaad94/pkg/tektonlog/tektonlog.go#L200

func (t *TektonLogger) GetRunningBuildLogs(ctx context.Context, pa *v1.PipelineActivity, pipelineRuns []*tektonapis.PipelineRun, buildName string) <-chan LogLine {
	ch := make(chan LogLine)
	go func() {
		defer close(ch)
		err := t.getRunningBuildLogs(ctx, pa, pipelineRuns, buildName, ch)
		if err != nil {
			t.err = err
		}
	}()
	return ch
}

On the case the Pod being logged takes time to complete, or is even stuck on a state because one of his container is in Error, then the jx-build-controller will be stuck at this state

{"timestamp":"2022-03-29T14:35:23.899278788Z","message":"logging pod: jx3-preview-integration-tests-r6525-test-fail-tfs9f-pod-c7qn6 for task test-fail","severity":"INFO","context":{}}

The log gathering needs to be non blocking

@rajatgupta24
Copy link
Member

I will start working on this

@JordanGoasdoue
Copy link
Author

Thanks @rajatgupta24, if you need to talk about this, to be able to reproduce etc, I am on slack :)

@msvticket msvticket removed the good first issue Good for newcomers label Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants