Skip to content

Open the asset server connection before the scene needs it - #7317

Open
camevor wants to merge 2 commits into
isaac-sim:developfrom
camevor:asset-server-prewarm
Open

Open the asset server connection before the scene needs it#7317
camevor wants to merge 2 commits into
isaac-sim:developfrom
camevor:asset-server-prewarm

Conversation

@camevor

@camevor camevor commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Description

Every remote asset lookup is one round trip on a kept-alive connection, but the first one also pays DNS resolution and the TCP and TLS handshakes. Instead, open the connection on a background thread once the extensions are loaded, so the handshake overlaps with the rest of startup. A run whose configured asset root is local opens no connection at all.

Type of change

  • (Startup performance enhancement)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump extension.toml — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

Every remote asset lookup is one round trip on a kept-alive connection,
but the first one also pays DNS resolution and the TCP and TLS
handshakes. Instead, open the connection on a background thread once the
extensions are loaded, so the handshake overlaps with the rest of
startup. A run whose configured asset root is local opens no connection
at all.
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Aug 24, 2026
@camevor
camevor marked this pull request as ready for review August 24, 2026 13:44
@camevor
camevor requested a review from a team August 24, 2026 13:44

@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

The asset-server prewarm is appropriately isolated in a private assets helper and covered for remote, repeated, and local-root behavior. One startup-order issue should be fixed: importing the assets module before the post-extension path sanitization can permanently cache dependencies from a conflicting Kit path.

  • Design and architecture: The lifecycle split is sound: AppLauncher triggers the work after extensions load, while the assets module owns remote-root detection and the deferred omni.client operation. However, the trigger must occur after AppLauncher restores the intended Python import precedence.
  • API: No public API compatibility issue is introduced. The helper remains private, existing asset-root symbols are unchanged, and the user-visible startup behavior has an appropriately phrased changelog fragment.
  • Implementation: The one-shot guard, background daemon thread, local-path filtering, and deferred error handling match the intended prewarm behavior. Move the import and call below _deprioritize_prebundle_paths(); otherwise assets.py and its module-level dependencies, including filelock, may be resolved and cached from conflicting pip_prebundle paths before sanitization can take effect.

Minor fixes needed. Posted 1 actionable finding inline.

Automated review; human maintainers own approval decisions.

# Nothing has asked for an asset yet, and the first thing that does -- building the
# scene -- would otherwise pay the connection handshake before its own lookup. Open
# it now instead, in the background.
from isaaclab.utils.assets import _prewarm_asset_server

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.

🟡 Warning · Implementation — Prewarm import precedes path sanitization

This imports isaaclab.utils.assets (which imports filelock at module scope) before the _deprioritize_prebundle_paths() pass a few lines below, whose comment states the second pass exists because Kit and its extensions may have just inserted conflicting pip_prebundle directories onto sys.path. Modules resolved and cached here cannot be corrected afterwards. Move the prewarm import and call below _deprioritize_prebundle_paths(); the startup overlap benefit is unchanged.

@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR starts a best-effort background request to a configured remote asset root after Isaac Sim extensions load, allowing connection setup to overlap the remaining startup work. It skips local roots, suppresses prewarm failures, and adds coverage for remote and local configurations.

  • Adds asset-server prewarming to AppLauncher.
  • Uses a single daemon thread to issue the initial remote omni.client.stat.
  • Adds tests for one-time remote prewarming and local-root exclusion.
  • Adds the required changelog fragment.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete changed-code failure identified.

The prewarm is limited to remote roots, runs after extension loading, contains failures without changing normal lookup behavior, and is covered for its principal remote and local cases.

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/app/app_launcher.py Starts asset-server prewarming after extensions load and before scene construction.
source/isaaclab/isaaclab/utils/assets.py Adds a guarded, best-effort daemon thread that contacts only remote configured asset roots.
source/isaaclab/test/utils/test_assets.py Covers one-time remote prewarming and verifies that POSIX and Windows local roots are ignored.
source/isaaclab/changelog.d/asset-server-prewarm.rst Documents the startup-performance enhancement and local-root behavior.

Sequence Diagram

sequenceDiagram
    participant L as AppLauncher
    participant P as Prewarm thread
    participant C as omni.client
    participant S as Scene construction
    L->>L: Load Isaac Sim extensions
    L->>P: Start daemon thread for remote root
    par Connection prewarm
        P->>C: stat(asset root)
    and Remaining startup
        L-->>S: Return initialized application
        S->>C: Perform first asset lookup
    end
Loading

Reviews (1): Last reviewed commit: "Open the asset server connection before ..." | Re-trigger Greptile

@ooctipus

Copy link
Copy Markdown
Collaborator

HI @camevor
do you know how much improvement this pr gives?
In my end it seems only improve 50-100ms

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

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants