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

[removal] AccessController in java.security has been deprecated and marked for removal #1590

Closed
HenryL27 opened this issue Nov 3, 2023 · 4 comments · Fixed by #2195
Closed
Labels
enhancement New feature or request Priority-Low

Comments

@HenryL27
Copy link
Collaborator

HenryL27 commented Nov 3, 2023

Idk if it's just me, but I think this is ugly every time I compile the project. What would it take to make these go away?

/Users/hmlin/Aryn/mlc-hml/ml-commons/ml-algorithms/src/main/java/org/opensearch/ml/engine/ModelHelper.java:64: warning: [removal] AccessController in java.security has been deprecated and marked for removal
            AccessController.doPrivileged((PrivilegedExceptionAction<Void>) () -> {
            ^
/Users/hmlin/Aryn/mlc-hml/ml-commons/ml-algorithms/src/main/java/org/opensearch/ml/engine/ModelHelper.java:165: warning: [removal] AccessController in java.security has been deprecated and marked for removal
            return AccessController.doPrivileged((PrivilegedExceptionAction<List>) () -> {
                   ^
/Users/hmlin/Aryn/mlc-hml/ml-commons/ml-algorithms/src/main/java/org/opensearch/ml/engine/ModelHelper.java:196: warning: [removal] AccessController in java.security has been deprecated and marked for removal
            AccessController.doPrivileged((PrivilegedExceptionAction<Void>) () -> {
            ^
/Users/hmlin/Aryn/mlc-hml/ml-commons/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/DLModelExecute.java:135: warning: [removal] AccessController in java.security has been deprecated and marked for removal
            AccessController.doPrivileged((PrivilegedExceptionAction<Void>) () -> {
            ^
/Users/hmlin/Aryn/mlc-hml/ml-commons/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/DLModel.java:80: warning: [removal] AccessController in java.security has been deprecated and marked for removal
            return AccessController.doPrivileged((PrivilegedExceptionAction<ModelTensorOutput>) () -> {
                   ^
/Users/hmlin/Aryn/mlc-hml/ml-commons/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/DLModel.java:242: warning: [removal] AccessController in java.security has been deprecated and marked for removal
            AccessController.doPrivileged((PrivilegedExceptionAction<Void>) () -> {
            ^
/Users/hmlin/Aryn/mlc-hml/ml-commons/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/rcf/RCFModelSerDeSer.java:26: warning: [removal] AccessController in java.security has been deprecated and marked for removal
            AccessController.doPrivileged((PrivilegedAction<Schema<RandomCutForestState>>) () ->
            ^
/Users/hmlin/Aryn/mlc-hml/ml-commons/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/rcf/RCFModelSerDeSer.java:29: warning: [removal] AccessController in java.security has been deprecated and marked for removal
            AccessController.doPrivileged((PrivilegedAction<Schema<ThresholdedRandomCutForestState>>) () ->
            ^
/Users/hmlin/Aryn/mlc-hml/ml-commons/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/rcf/RCFModelSerDeSer.java:58: warning: [removal] AccessController in java.security has been deprecated and marked for removal
        byte[] bytes = AccessController.doPrivileged((PrivilegedAction<byte[]>) () -> ProtostuffIOUtil.toByteArray(model, schema, buffer));
                       ^
/Users/hmlin/Aryn/mlc-hml/ml-commons/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/rcf/RCFModelSerDeSer.java:64: warning: [removal] AccessController in java.security has been deprecated and marked for removal
        AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
        ^
/Users/hmlin/Aryn/mlc-hml/ml-commons/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/ConnectorUtils.java:121: warning: [removal] AccessController in java.security has been deprecated and marked for removal
            AccessController.doPrivileged((PrivilegedExceptionAction<Void>) () -> {
            ^
/Users/hmlin/Aryn/mlc-hml/ml-commons/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/HttpJsonConnectorExecutor.java:93: warning: [removal] AccessController in java.security has been deprecated and marked for removal
            AccessController.doPrivileged((PrivilegedExceptionAction<Void>) () -> {
            ^
/Users/hmlin/Aryn/mlc-hml/ml-commons/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/AwsConnectorExecutor.java:82: warning: [removal] AccessController in java.security has been deprecated and marked for removal
            HttpExecuteResponse response = AccessController.doPrivileged((PrivilegedExceptionAction<HttpExecuteResponse>) () -> {
                                           ^
/Users/hmlin/Aryn/mlc-hml/ml-commons/ml-algorithms/src/main/java/org/opensearch/ml/engine/MLEngineClassLoader.java:42: warning: [removal] AccessController in java.security has been deprecated and marked for removal
            AccessController.doPrivileged((PrivilegedExceptionAction<Void>) () -> {
            ^
@austintlee
Copy link
Collaborator

Probably this needs to happen.

@ylwu-amzn
Copy link
Collaborator

Yes, we need a campaign for all OpenSearch repos to replace java security manager

@pfirmstone
Copy link

Create wrapper methods for the deprecated API, and replace all calls, another level of indirection, then there will be less warnings, when you eventually remove support, you can remove the call, or support platforms that have the methods or don't by using reflection, and provide a property that disables or enables its use. Consider packaging the wrapper API within its own jar or module, since it will likely need to be privileged.

Just suggestions.

@mingshl
Copy link
Collaborator

mingshl commented Mar 12, 2024

pending on changes in opensearch-core. assign to @reta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Priority-Low
Projects
5 participants