Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] DropIns - Prevention of File Locks and Unloading #5943

Closed
RenatoCapelo opened this issue Sep 4, 2024 · 0 comments · Fixed by #5944
Closed

[ENH] DropIns - Prevention of File Locks and Unloading #5943

RenatoCapelo opened this issue Sep 4, 2024 · 0 comments · Fixed by #5944
Labels
enhancement New feature or request

Comments

@RenatoCapelo
Copy link
Contributor

Enhancement Request

Context

At the present time there are two ways to insert drop-ins onto Elsa.

  1. Via NuGet Packages

    • Unzips the package and loads each DLL onto memory
    • Doesn't lock the file since it's closed after copying the DLLs onto memory
    • When the original .npkg is deleted the associated drop-ins are not unregistered from the registry
  2. Via DLLs

    • Loads directly the Assembly from the DLL
    • Locks the file since the Assembly is pointing to the DLL file

Planned Implementation

  1. Change Drop-in Directory Monitor to allow tracking of the installed Drop-ins
    • Every time a drop-in is added, it should be added to a dictionary having the key as the path and the value the drop-ins associated to that file
  2. Prevent the File locking of DLLs
    • Implement something similar to the NuGet's behavior (copy the DLL to a memory stream and load it from there). This will prevent the file locking.
      • If needed, this can possibly be improved on the future to copy the DLLs to an internal folder to not consume unbearable amounts of ram
  3. Change Drop-ins to allow a safe unregister
    • Add a Unconfigure method to the IDropIn interface.
      • This method's implementation should unregister the activity from the registry as well as possible added services to the service provider.
  4. Change Drop-ins Directory Monitor to keep track of deletion events
    • Add a callback function for the watcher.Deleted
      • This function will retrieve all drop-ins associated with the path that was deleted and call their Unconfigure method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant