-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
UI Jobs streams are not cleaned up after PR is closed #5348
Comments
Hey @quynhnhatnguyen 👋, I'm here to help you with any bugs, questions, or contributions. Let's tackle this issue together! The issue you're experiencing, where UI job streams are not cleaned up after a PR is closed, seems to be related to the cleanup process managed by the The expected behavior is that log streaming resources should be cleaned up, workspaces deleted, and locks removed when a PR is closed [2]. If this is not happening, it might indicate a bug or misconfiguration in the cleanup process. To address this issue, you might want to:
If the problem persists, it might be helpful to look into the specific implementation details or logs to identify any errors during the cleanup process. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
@quynhnhatnguyen, can you check if those logs are complete? We are seeing logs being persistent as well but when clicked the displayed log is truncated. If the log page is refreshed it is truncated at a different spot during each refresh. The full log was posted in the comment correctly. Running atlantis:v0.33.0 container deployed via terraform-gce-atlantis?ref=v4.2.0 |
@joe1981al ours is not truncated. The full log is persistent in the streams of closed PRs in my test. |
@quynhnhatnguyen my live log issue is unrelated, submitted issue to gce-terraform-atlantis for that. Which git repo are you using? We are using Azure DevOps and seeing similar behavior. I'm not familiar with golang but took a stab at debugging. Seeing a behavior here that seems unexpected. It's not matching in the if statement and skips the cleanup steps. Added some logging and {
"{54106 repo azureorg/project/repo terraform/project/path default}": {
"0cea6de8-5618-405f-b819-42d377b6f5ae": {
"JobID": "0cea6de8-5618-405f-b819-42d377b6f5ae",
"JobIDUrl": "",
"JobDescription": "",
"Time": "2025-02-21T12:44:55.947183432-06:00",
"TimeFormatted": "",
"JobStep": "plan"
}
}
} but pullInfo contains
With this, I assume the load fails to find the job id which causes the failure. Going to see if I can find where pullinfo is populated and see how hard it is to update. |
Believe I have it figured out, have it working locally. This area, I believe, adds entries to the plan log and has several inputs for pullinfo that are not populated in this section when a cleanup is called. If updated as below, it succeeds in deleting the plan log and entries disappear from UI. if pullStatus != nil {
for _, project := range pullStatus.Projects {
jobContext := jobs.PullInfo{
PullNum: pull.Num,
Repo: pull.BaseRepo.Name,
RepoFullName: pull.BaseRepo.FullName,
ProjectName: project.ProjectName,
Path: project.RepoRelDir,
Workspace: project.Workspace,
}
p.LogStreamResourceCleaner.CleanUp(jobContext)
}
} |
Issue has likely existed for over a year since this commit added more fields to PullInfo but did not update all things that use it to include those new fields. |
@joe1981al Thanks for the quick confirmation and patch. Do you want to make a PR for this fix? |
Community Note
Overview of the Issue
Atlantis UI Jobs Stream are not cleaned up after a PR is closed, resulted in system resource are not freed up.
Reproduction Steps
repos
dir is also cleaned up fine. Visit the previous job stream URL to confirm that you still can see the streams.Environment details
Additional Context
Screenshots of before closing the PR:


Screenshots of after closing the PR:
The text was updated successfully, but these errors were encountered: