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

Unregister runtime artifacts #2485

Closed
7 tasks
bajtos opened this issue Feb 26, 2019 · 8 comments
Closed
7 tasks

Unregister runtime artifacts #2485

bajtos opened this issue Feb 26, 2019 · 8 comments

Comments

@bajtos
Copy link
Member

bajtos commented Feb 26, 2019

When discovering & defining models at run-time (see #2484), it's often important to allow applications to remove artifacts that are no longer used.

In LoopBack 3.x, we provide the following API:

app.deleteModelByName(modelName);

The situation is more complex in LB4, because there are multiple artifacts involved in exposing a data table/collection via REST API:

  • Model
  • Repository or Service proxy
  • Controller

Acceptance criteria

@marioestradarosa
Copy link
Contributor

like a garbage collector?.

  • in this case datasource classes that connects to the database, do they close their connections once unregistered
  • Could you specify unregister ?
    unbind it?

@jannyHou
Copy link
Contributor

Tip: After removing the artifact, make sure the extension point also remove it from cache/rebuild the cache

e.g. Routing table watches the view of controller, make sure it refresh the cache when controller goes.

Suggestion: The scope of this story is too big, we can have a spike for all artifacts and figure out the scope of unregistering them.

@bajtos
Copy link
Member Author

bajtos commented Mar 18, 2019

@marioestradarosa

like a garbage collector

We need to delete all references to the artifact we want to remove, so that the garbage collector can reclaim the memory used by that artifact.

in this case datasource classes that connects to the database, do they close their connections once unregistered

Yes, they should close their connections as part of the unregistering workflow.

Could you specify unregister ? unbind it?

I think that's something we need to find out, probably in a spike story.

@emonddr
Copy link
Contributor

emonddr commented Mar 19, 2019

This should leverage the lifecycle support mentioned in : #1928

@dhmlau
Copy link
Member

dhmlau commented Mar 21, 2019

Created #2619 for the spike.

@bajtos bajtos added the p3 label Apr 11, 2019
@dhmlau dhmlau added 2019Q3 and removed 2019Q2 labels Apr 16, 2019
@dhmlau dhmlau added 2019Q4 and removed 2019Q3 labels Jun 25, 2019
@dhmlau dhmlau removed the 2019Q4 label Sep 12, 2019
@stale
Copy link

stale bot commented Sep 7, 2020

This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository. This issue will be closed within 30 days of being stale.

@stale stale bot added the stale label Sep 7, 2020
@dhmlau dhmlau removed the stale label Sep 7, 2020
@stale
Copy link

stale bot commented Jul 14, 2021

This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository. This issue will be closed within 30 days of being stale.

@stale stale bot added the stale label Jul 14, 2021
@stale
Copy link

stale bot commented Aug 13, 2021

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

@stale stale bot closed this as completed Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants