Skip to content

fix(plugin): report a partial unload when a JAR replace fails #117

Open

Description

@fronzec

Problem Description

DynamicJobLoaderService.doReplaceJar sets unloaded = true only after doUnloadJob(definitionId, false) returns. doUnloadJob unregisters the plugin (pluginRegistryService.unregisterDynamicPlugin) and closes its classloader before it saves the UNLOADED status. If that save throws, the plugin is already unregistered on this instance, but the JAR_REPLACED FAILURE audit says "Nothing was changed; ..." because unloaded is still false.

Proposed Solution

Make the failure outcome reflect how far the unload got. For example, have the unload report the point it reached, or mark the replace as unloaded as soon as the plugin is unregistered, so the audit says the plugin was unregistered and is no longer runnable on this instance.

Acceptance Criteria

  • When the unload fails after unregistering the plugin, the JAR_REPLACED FAILURE audit does not say "Nothing was changed" and names the plugin's actual state.
  • The new JAR is still discarded in that case.
  • A test simulates a failure of the UNLOADED save during replace and asserts the audit text.

Affected Area

Plugin lifecycle: job definition JAR replace

Out of Scope

  • Re-registering the plugin automatically after a failed unload.

Additional Context

Follow-up to #108 / PR #113.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions