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

feat: provide multitenancy runtime #477

Closed
wants to merge 1 commit into from
Closed

Conversation

ndr-brt
Copy link
Contributor

@ndr-brt ndr-brt commented Oct 17, 2022

what

Provides multi-tenancy extension with a MultiTenantRuntime class, that can be used to run a multi-tenant EDC

why

This is a requirement for PI6

notes

  • I created a samples folder containing a sample that shows how the multi-tenancy could be used

@ndr-brt ndr-brt force-pushed the feature/multitenancy branch from f6c2a9c to d398b5b Compare October 17, 2022 14:25
@ndr-brt ndr-brt marked this pull request as ready for review October 17, 2022 14:46
Comment on lines +56 to +66
try (var classLoader = URLClassLoader.newInstance(entries, getSystemClassLoader())) {
var runtimeThread =
new Thread(
() -> {
try {
Thread.currentThread().setContextClassLoader(classLoader);
super.boot();
} catch (Exception e) {
throw new EdcException(e);
}
});
Copy link
Contributor

@denisneuling denisneuling Oct 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: If the Classloader instance is closed, once the thread has been instantiated, is it still capable to use it? For my understanding once the resource has been closed it shouldn't be able to be used anymore and all associated refs going to be gc'ed...

Copy link
Contributor Author

@ndr-brt ndr-brt Oct 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woa, you're right, I didn't closed it at first, but then SonarCloud said like "hey, you have to close it", it was afternoon and I listened too it without asking a lot :D
Will fix it

Actually I tested it, load up the sample connector with 3 tenants with "in memory" stores, start pushing data, after GC intervention everything is still working correctly.
This is a concept and we need to test it further, but for the moment it seems to work

@ndr-brt ndr-brt force-pushed the feature/multitenancy branch from c4355df to 8d57a79 Compare October 18, 2022 07:09
@ndr-brt ndr-brt force-pushed the feature/multitenancy branch from 8d57a79 to f532402 Compare October 25, 2022 11:50
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 1 Bug
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@ndr-brt
Copy link
Contributor Author

ndr-brt commented Nov 15, 2022

Closed as not really necessary

@ndr-brt ndr-brt closed this Nov 15, 2022
@ndr-brt ndr-brt deleted the feature/multitenancy branch November 29, 2022 10:02
@ndr-brt ndr-brt restored the feature/multitenancy branch November 29, 2022 10:02
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