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

Fix AdmissionControl class loading issue in Netty/PA communication #402

Merged
merged 3 commits into from
Mar 24, 2023

Conversation

gashutos
Copy link
Contributor

@gashutos gashutos commented Mar 19, 2023

Is your feature request related to a problem? Please provide an existing Issue # , or describe.
PA AdmissionControl colector is taking dependency on AOS's AdmissionControl plugin to retrieve JVMMP & Request_Size
quota related metrics. PA uses reflection to retrieve static insances of AdmissionControllers.
Unit now it worked fine since, Jetty plugin was in /lib diretory and was getting loaded by same classloader. But now that AOS is moving to Netty, Netty is completely seperate plugin and no in /lib folder. Hence PA & Netty plugins shares different classloaders. However, there is a way we can still load AdmissionControl classes with parent ClassLoaders. PluginService when loads extended plugins, it passes parent classloader for all extended plugins. Ref
We will have to add a line, in opensearch-performance-analyzer plugin. So that PluginService passes AdmissionControl class loader to PA.

Describe alternatives you've considered
The cleanest way to implement this would be to provide an SPI from PA and AdmissionControl will use this SPI to implement controllers. In that way, PA will be [ExtensiblePlugin](https://github.com/opensearch-project/OpenSearch/blob/main/server/src/main/java/org/opensearch/plugins/ExtensiblePlugin.java) and AdmissionControl plugin will extend PA plugin, I tried doing that and it resulted in lot of complications, like jar hell, dependencies version conflicts etc. Also this approach will clash with Jetty as now we will have tow different solutions for Netty/Jetty. We can still handle all those scenarios, but I would suggest to keep that task on our backlog (including making AdmissionControl plugin opensource).

Additional context
Add any other context or screenshots about the feature request here.

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

linuxpi
linuxpi previously approved these changes Mar 20, 2023
khushbr
khushbr previously approved these changes Mar 23, 2023
linuxpi
linuxpi previously approved these changes Mar 24, 2023
@gashutos
Copy link
Contributor Author

Look for long term solution as mentioned in this issue.
#403

@gashutos gashutos dismissed stale reviews from linuxpi and khushbr via 9f6eade March 24, 2023 10:26
@khushbr khushbr merged commit 7c9a493 into opensearch-project:main Mar 24, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 27, 2023
)

* Fix AdmissionControl class loading issue in Netty/PA communication

Signed-off-by: gashutos <[email protected]>

* Addressing review comments

Signed-off-by: gashutos <[email protected]>

* Correcting type

---------

Signed-off-by: gashutos <[email protected]>
(cherry picked from commit 7c9a493)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 27, 2023
)

* Fix AdmissionControl class loading issue in Netty/PA communication

Signed-off-by: gashutos <[email protected]>

* Addressing review comments

Signed-off-by: gashutos <[email protected]>

* Correcting type

---------

Signed-off-by: gashutos <[email protected]>
(cherry picked from commit 7c9a493)
khushbr added a commit to khushbr/performance-analyzer that referenced this pull request Mar 30, 2023
khushbr added a commit that referenced this pull request Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants