-
Notifications
You must be signed in to change notification settings - Fork 50
fix(QTDI-1638): thread safe component manager #1053
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
base: master
Are you sure you want to change the base?
fix(QTDI-1638): thread safe component manager #1053
Conversation
There was a problem hiding this comment.
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 introduces thread safety improvements for the component manager while also refactoring some stream operations and enhancing the multithreaded test coverage. Key changes include:
- Replacing lambda expressions with method references and refactoring stream operations for clarity.
- Introducing a ReentrantReadWriteLock to protect shared state in the ComponentManager.
- Adding unit tests for multithreaded auto-discovery of plugins.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
container/container-core/src/main/java/org/talend/sdk/component/container/ContainerManager.java | Refactored stream operations using method references and String.join for clarity. |
component-runtime-manager/src/test/java/org/talend/sdk/component/runtime/manager/asm/PluginGenerator.java | Added proper closing of JAR entries and introduced a dependencies file entry. |
component-runtime-manager/src/test/java/org/talend/sdk/component/runtime/manager/ComponentManagerTest.java | Introduced multithreaded tests for plugin auto-discovery with added parameterized testing. |
component-runtime-manager/src/main/java/org/talend/sdk/component/runtime/manager/ComponentManager.java | Implemented thread safety via ReentrantReadWriteLock in multiple methods and adjusted API calls accordingly. |
Comments suppressed due to low confidence (1)
component-runtime-manager/src/test/java/org/talend/sdk/component/runtime/manager/asm/PluginGenerator.java:110
- The error message contains a spelling mistake ('occured' should be 'occurred').
outputStream.write(("error=An error occured").getBytes(StandardCharsets.UTF_8));
...ime-manager/src/test/java/org/talend/sdk/component/runtime/manager/ComponentManagerTest.java
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Analysis Details1 IssueCoverage and DuplicationsProject ID: org.talend.sdk.component:component-runtime |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Requirements
Why this PR is needed?
https://qlik-dev.atlassian.net/browse/QTDI-1638
What does this PR adds (design/code thoughts)?