-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
During the course of a separate PR [1], it was observed that java.lang.ref.Cleaner::create checks that the caller is allowed to create or start a thread - throws SecurityException if not. This is as designed and specified in the Java SE specification. The aforementioned PR [1] runs afoul of this, since it would appear to be the first time that Cleaner is being used in the code base or a transitive dependency.
By default, and with a security manager installed, the JDK implementation will create a new InnocuousThread to execute the clean actions of a Cleaner. With the phased migration away from finalizers, it is likely that more libraries will start to adopt j.l.ref.Cleaner. The ES security manager should tolerate its use without the need for each and every codebase to be granted an explicit permission.
When this issue is resolved, the aforementioned PR [1] can remove its changes that relate to dealing with the security manager aspects of granting and checking modifyInnocuousThread.
[1] relates #77012