Skip to content

Stop removing modules from sys.modules while Kit starts - #8816

Open
mfinean wants to merge 2 commits into
isaac-sim:mainfrom
mfinean:fix/kit-launcher-sys-modules
Open

mfinean wants to merge 2 commits into
isaac-sim:mainfrom
mfinean:fix/kit-launcher-sys-modules

Conversation

@mfinean

@mfinean mfinean commented Oct 25, 2026

Copy link
Copy Markdown

Description

KitLauncher._create_app removed every module matching .*lab.* from sys.modules while SimulationApp started. In that window, other threads can't pickle from those modules, and importing one creates a second copy. It also reset sys.stdout to sys.__stdout__ afterwards, dropping any redirect set up before the launch.

The purge dates from when Isaac Lab's packages were named omni.isaac.lab and tripped SimulationApp's warning about omni* and pxr* modules loaded before startup. The isaaclab packages don't match that check, so this removes it, and restores the previous sys.stdout in a finally block.

Fixes #8812

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Testing

  • The new test in test_kit_launcher.py stubs SimulationApp and checks that modules stay in sys.modules during startup and that sys.stdout is restored when startup fails. It fails on main.
  • Started Kit through launch_simulation on Isaac Sim 6.2, twice on main and twice with this change. The console output was the same apart from timings, and the module warning listed only a dummy omni* module I imported on purpose. Pickling from a *lab* module on another thread during startup failed on main and worked with this change.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have validated the changed behavior with focused coverage and applied the test-audit criteria to any test changes
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump package versions — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

KitLauncher._create_app removed every module matching .*lab.* from
sys.modules while SimulationApp started, so other threads could not
pickle from or import those modules, and then reset sys.stdout to
sys.__stdout__. The purge dates from when Isaac Lab's packages were
named omni.isaac.lab and tripped SimulationApp's check for omni and pxr
modules. The isaaclab packages don't match that check, so drop it, and
restore the previous sys.stdout in a finally block.

Fixes isaac-sim#8812

Signed-off-by: Mark Finean <33692727+mfinean@users.noreply.github.com>
@mfinean
mfinean requested a review from a team October 25, 2026 17:25
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Oct 25, 2026
@greptile-apps

greptile-apps Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

KitLauncher._create_app stops temporarily removing modules whose names contain lab from sys.modules.

  • Isaac Sim startup keeps imported modules available and restores the caller's output stream.
  • Mark Finean now appears in the contributor list.

No actionable issues were found. Tests were inspected, not run.

Reviews (1) · Last reviewed commit: "Stop removing modules from sys.modules w..." · Reviewed by Greptile

@isaaclab-review-bot isaaclab-review-bot Bot 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.

Isaac Lab Review Bot

All reviewed code categories look good.

  • PR description: The body matches the diff; change “modules stay” to “the Kit launcher module stays,” since the test checks one module, while the broader behavior is supported by manual validation.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: No over-engineering issues.
  • API: API changes look good.
  • Compatibility and deprecation: No breaking changes identified.
  • Implementation: Implementation looks good.
  • Style consistency: Style consistency looks good.
  • Test quality: Test quality looks good.

No blocking issues. No inline findings.

Automated review; human maintainers own approval decisions.

@AntoineRichard AntoineRichard left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks a lot @mfinean for catching this. I agree, it should be fine.

@AntoineRichard

Copy link
Copy Markdown
Collaborator

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Oct 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report] KitLauncher removes all "*lab*" modules from sys.modules and redirects stdout while Kit starts

3 participants