Skip to content

Improve temp dir cleanup in xe class - #68

Open
BrennanGit wants to merge 7 commits into
developfrom
feature/better_cleanup
Open

BrennanGit wants to merge 7 commits into
developfrom
feature/better_cleanup

Conversation

@BrennanGit

Copy link
Copy Markdown
Contributor

I'm not sure a good way to actually test the things in this repo so would appreciate some help in review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Cleanup failures remain silent, forced termination can still leak directories, and the unrelated CI migration needs clarification.

Review effort: Balanced
Findings: 3 Medium severity

Open (3)
What changed in this PR

Improves cleanup of temporary directories used for XE inspection and simulator execution.

Changes:

  • Adds explicit, idempotent XE cleanup.
  • Ensures cleanup during initialization and simulation failures.
  • Migrates the Jenkins pipeline to newer shared-library APIs.
File Description
lib/​python/​Pyxsim/​xe.py Adds explicit temporary-directory cleanup.
lib/​python/​Pyxsim/​pyxsim.py Cleans XE resources during termination.
lib/​python/​Pyxsim/​__init__.py Adds cleanup around simulation and tracing.
Jenkinsfile Updates CI library and repository checks.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Jenkinsfile Outdated
Comment on lines +206 to +207
finally:
xsi.terminate()
Comment thread lib/python/Pyxsim/xe.py Outdated
@xross

xross commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

I'm not sure a good way to actually test the things in this repo so would appreciate some help in review.

We really need to add tests to his repo!

What was the high-level problem you were trying to solve here?

@BrennanGit

BrennanGit commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Basically, the ubu builders got overwhelmed recently by builds from lib_voice and soundwire which killed them with OOM errors.

When I tried to bring them back, they got stuck on a start job for >30m which turned out to be them deleting thousands upon thousands of small directories in /tmp.

Even now if I go and check a "healthy" builder, there are 31423 folders in /tmp with the contents like config.xml image_n0c0.elf platform_def.xn program_info.txt xscope.xscope.

I checked a couple of the elf headers and found some for soundwire and for i3c so I suspect its the shared code in pyxsim thats not cleaning up the temp dirs properly.

BrennanGit and others added 4 commits October 1, 2026 10:35
Handle exceptions when closing resources and ensure cleanup.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This reverts commit cabfaa1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants