Remove Security Manager usage from x-pack ml#145043
Remove Security Manager usage from x-pack ml#145043jdconrad wants to merge 3 commits intoelastic:mainfrom
Conversation
- NamedPipeHelper: remove SpecialPermission.check() guards and AccessController.doPrivileged wrappers around pipe open operations; drop PrivilegedAction from inner helper classes - DomainSplitFunction: inline two doPrivileged calls — one wrapping resource file loading in static init, one wrapping a deprecation warning emitted from script context - LinearProgrammingPlanSolver: inline privilegedModelMaximise() and remove doPrivileged wrapper around ojalgo model.maximise(); remove @SuppressWarnings("removal") annotation SecurityManager was removed in JDK 17 (JEP 411) and AccessController is deprecated for removal since JDK 17. All of this code was dead. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Now that FileInputStream/FileOutputStream are called directly (no longer wrapped in AccessController.doPrivileged), IOException is caught directly in the retry loops and can be rethrown as-is. The wrapping in RuntimeException and the propagateWrappedException unwrapper are no longer needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughRemoved Java security context wrapping and privilege elevation logic from three ML utility and planning modules. The changes eliminate ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
| } catch (InterruptedException ie) { | ||
| Thread.currentThread().interrupt(); | ||
| propagatePrivilegedException(e); | ||
| throw e; |
There was a problem hiding this comment.
Was this a bug to begin with? Do we want to throw the outer exception here or the InterruptedException?
There was a problem hiding this comment.
If there are multiple exceptions let's make sure to use addSuppressed to not lose it completely
Removes all
AccessController.doPrivileged,PrivilegedAction, andSecurityManagerusage from the x-pack ml plugin.ES-14393