Skip to content

Fix structure of EpLibraryPlugin::Load so that we call Unload on error.#29634

Open
skottmckay wants to merge 2 commits into
mainfrom
skottmckay/FixCleanupOnPluginEpLibraryLoadFailure
Open

Fix structure of EpLibraryPlugin::Load so that we call Unload on error.#29634
skottmckay wants to merge 2 commits into
mainfrom
skottmckay/FixCleanupOnPluginEpLibraryLoadFailure

Conversation

@skottmckay

Copy link
Copy Markdown
Contributor

Description

Fix structure of EpLibraryPlugin::Load so that we call Unload on any error and not just an exception.
Currently we directly return on error so the Unload is never hit.

Motivation and Context

Cleanup failed load fully.

@skottmckay skottmckay requested review from Copilot and edgchen1 and removed request for edgchen1 July 9, 2026 08:13

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.

Pull request overview

This PR restructures EpLibraryPlugin::Load() to ensure that a partially loaded EP plugin library is cleaned up on any failure (returned error Status as well as exceptions), instead of only on exceptions.

Changes:

  • Wraps the library load sequence in an inner lambda so ORT_RETURN_IF_ERROR produces an error Status without returning from Load().
  • Adds a unified failure-path cleanup block intended to call Unload() on any non-OK status.

Comment thread onnxruntime/core/session/plugin_ep/ep_library_plugin.cc

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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

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.

2 participants