You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by Abhay Kulkarni <ak...@hortonworks.com> on 2022/06/01 20:46:19 UTC

Review Request 74007: RANGER-3606: Addendum to: "remove unnecessary static members from plugin class loaders" - Cannot find plugin-class-loader for TAG service-type in JDK11

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74007/
-----------------------------------------------------------

Review request for ranger, Madhan Neethiraj and Ramesh Mani.


Bugs: RANGER-3606
    https://issues.apache.org/jira/browse/RANGER-3606


Repository: ranger


Description
-------

JDK 11 JRE fails to create javascript Script-Engine for tag policies containing script conditions


Diffs
-----

  agents-common/src/main/java/org/apache/ranger/plugin/util/ScriptEngineUtil.java 79a702a8f 
  ranger-plugin-classloader/src/main/java/org/apache/ranger/plugin/classloader/RangerPluginClassLoader.java 7ed776ecb 


Diff: https://reviews.apache.org/r/74007/diff/1/


Testing
-------

Tested with JDK11. Passes all unit tests.


Thanks,

Abhay Kulkarni


Re: Review Request 74007: RANGER-3606: Addendum to: "remove unnecessary static members from plugin class loaders" - Cannot find plugin-class-loader for TAG service-type in JDK11

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74007/#review224481
-----------------------------------------------------------




ranger-plugin-classloader/src/main/java/org/apache/ranger/plugin/classloader/RangerPluginClassLoader.java
Line 94 (original), 87 (patched)
<https://reviews.apache.org/r/74007/#comment313254>

    For policies with resource having expressions, like ${{USER.dept}}, ResourceMatcher gets RangerPluginClassLoader instance with serviceType=null. In such case, block #72 - #85 will be triggered when pluginClassLoaders is not populated. This can be avoided by populating pluginClassLoaders with null key as well.


- Madhan Neethiraj


On June 2, 2022, 3:02 p.m., Abhay Kulkarni wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74007/
> -----------------------------------------------------------
> 
> (Updated June 2, 2022, 3:02 p.m.)
> 
> 
> Review request for ranger, Madhan Neethiraj and Ramesh Mani.
> 
> 
> Bugs: RANGER-3606
>     https://issues.apache.org/jira/browse/RANGER-3606
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> JDK 11 JRE fails to create javascript Script-Engine for tag policies containing script conditions
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/util/ScriptEngineUtil.java 79a702a8f 
>   ranger-plugin-classloader/src/main/java/org/apache/ranger/plugin/classloader/RangerPluginClassLoader.java 7ed776ecb 
> 
> 
> Diff: https://reviews.apache.org/r/74007/diff/2/
> 
> 
> Testing
> -------
> 
> Tested with JDK11. Passes all unit tests.
> 
> 
> Thanks,
> 
> Abhay Kulkarni
> 
>


Re: Review Request 74007: RANGER-3606: Addendum to: "remove unnecessary static members from plugin class loaders" - Cannot find plugin-class-loader for TAG service-type in JDK11

Posted by Abhay Kulkarni <ak...@hortonworks.com>.

> On June 3, 2022, 12:53 a.m., Madhan Neethiraj wrote:
> > agents-common/src/main/java/org/apache/ranger/plugin/util/ScriptEngineUtil.java
> > Lines 64 (patched)
> > <https://reviews.apache.org/r/74007/diff/2/?file=2268198#file2268198line64>
> >
> >     Consider using log level DEBUG here to avoid excessive logs.

Ack


> On June 3, 2022, 12:53 a.m., Madhan Neethiraj wrote:
> > ranger-plugin-classloader/src/main/java/org/apache/ranger/plugin/classloader/RangerPluginClassLoader.java
> > Line 94 (original), 87 (patched)
> > <https://reviews.apache.org/r/74007/diff/2/?file=2268199#file2268199line96>
> >
> >     It will help to retain populating pluginClassLoaders even when pluginType is null, so that subsequent calls with pluginType=null will return quickly from #61.
> >     
> >       if (ret != null) {
> >         pluginClassLoaders.put(pluginType, ret);
> >     
> >         if (pluginType != null && !pluginType.equals(TAG_SERVICE_TYPE)) {
> >           pluginClassLoaders.put(TAG_SERVICE_TYPE, ret);
> >         }
> >       }

In reality, the hashmap pluginClassLoaders will have size of exactly two (including that for 'tag' service-type)  even when there are chained plugins in the service, so this is a moot point.


> On June 3, 2022, 12:53 a.m., Madhan Neethiraj wrote:
> > ranger-plugin-classloader/src/main/java/org/apache/ranger/plugin/classloader/RangerPluginClassLoader.java
> > Lines 364 (patched)
> > <https://reviews.apache.org/r/74007/diff/2/?file=2268199#file2268199line373>
> >
> >     Consider using log level DEBUG in #364 and #367 to avoid excessive logs.

Ack.


- Abhay


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74007/#review224479
-----------------------------------------------------------


On June 2, 2022, 3:02 p.m., Abhay Kulkarni wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74007/
> -----------------------------------------------------------
> 
> (Updated June 2, 2022, 3:02 p.m.)
> 
> 
> Review request for ranger, Madhan Neethiraj and Ramesh Mani.
> 
> 
> Bugs: RANGER-3606
>     https://issues.apache.org/jira/browse/RANGER-3606
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> JDK 11 JRE fails to create javascript Script-Engine for tag policies containing script conditions
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/util/ScriptEngineUtil.java 79a702a8f 
>   ranger-plugin-classloader/src/main/java/org/apache/ranger/plugin/classloader/RangerPluginClassLoader.java 7ed776ecb 
> 
> 
> Diff: https://reviews.apache.org/r/74007/diff/2/
> 
> 
> Testing
> -------
> 
> Tested with JDK11. Passes all unit tests.
> 
> 
> Thanks,
> 
> Abhay Kulkarni
> 
>


Re: Review Request 74007: RANGER-3606: Addendum to: "remove unnecessary static members from plugin class loaders" - Cannot find plugin-class-loader for TAG service-type in JDK11

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74007/#review224479
-----------------------------------------------------------




agents-common/src/main/java/org/apache/ranger/plugin/util/ScriptEngineUtil.java
Lines 64 (patched)
<https://reviews.apache.org/r/74007/#comment313248>

    Consider using log level DEBUG here to avoid excessive logs.



ranger-plugin-classloader/src/main/java/org/apache/ranger/plugin/classloader/RangerPluginClassLoader.java
Line 94 (original), 87 (patched)
<https://reviews.apache.org/r/74007/#comment313250>

    It will help to retain populating pluginClassLoaders even when pluginType is null, so that subsequent calls with pluginType=null will return quickly from #61.
    
      if (ret != null) {
        pluginClassLoaders.put(pluginType, ret);
    
        if (pluginType != null && !pluginType.equals(TAG_SERVICE_TYPE)) {
          pluginClassLoaders.put(TAG_SERVICE_TYPE, ret);
        }
      }



ranger-plugin-classloader/src/main/java/org/apache/ranger/plugin/classloader/RangerPluginClassLoader.java
Lines 364 (patched)
<https://reviews.apache.org/r/74007/#comment313249>

    Consider using log level DEBUG in #364 and #367 to avoid excessive logs.


- Madhan Neethiraj


On June 2, 2022, 3:02 p.m., Abhay Kulkarni wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74007/
> -----------------------------------------------------------
> 
> (Updated June 2, 2022, 3:02 p.m.)
> 
> 
> Review request for ranger, Madhan Neethiraj and Ramesh Mani.
> 
> 
> Bugs: RANGER-3606
>     https://issues.apache.org/jira/browse/RANGER-3606
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> JDK 11 JRE fails to create javascript Script-Engine for tag policies containing script conditions
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/util/ScriptEngineUtil.java 79a702a8f 
>   ranger-plugin-classloader/src/main/java/org/apache/ranger/plugin/classloader/RangerPluginClassLoader.java 7ed776ecb 
> 
> 
> Diff: https://reviews.apache.org/r/74007/diff/2/
> 
> 
> Testing
> -------
> 
> Tested with JDK11. Passes all unit tests.
> 
> 
> Thanks,
> 
> Abhay Kulkarni
> 
>


Re: Review Request 74007: RANGER-3606: Addendum to: "remove unnecessary static members from plugin class loaders" - Cannot find plugin-class-loader for TAG service-type in JDK11

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74007/#review224482
-----------------------------------------------------------


Ship it!




Ship It!

- Madhan Neethiraj


On June 3, 2022, 2:52 a.m., Abhay Kulkarni wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74007/
> -----------------------------------------------------------
> 
> (Updated June 3, 2022, 2:52 a.m.)
> 
> 
> Review request for ranger, Madhan Neethiraj and Ramesh Mani.
> 
> 
> Bugs: RANGER-3606
>     https://issues.apache.org/jira/browse/RANGER-3606
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> JDK 11 JRE fails to create javascript Script-Engine for tag policies containing script conditions
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/util/ScriptEngineUtil.java 79a702a8f 
>   ranger-plugin-classloader/src/main/java/org/apache/ranger/plugin/classloader/RangerPluginClassLoader.java 7ed776ecb 
> 
> 
> Diff: https://reviews.apache.org/r/74007/diff/3/
> 
> 
> Testing
> -------
> 
> Tested with JDK11. Passes all unit tests.
> 
> 
> Thanks,
> 
> Abhay Kulkarni
> 
>


Re: Review Request 74007: RANGER-3606: Addendum to: "remove unnecessary static members from plugin class loaders" - Cannot find plugin-class-loader for TAG service-type in JDK11

Posted by Abhay Kulkarni <ak...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74007/
-----------------------------------------------------------

(Updated June 3, 2022, 2:52 a.m.)


Review request for ranger, Madhan Neethiraj and Ramesh Mani.


Changes
-------

Addressed review comments


Bugs: RANGER-3606
    https://issues.apache.org/jira/browse/RANGER-3606


Repository: ranger


Description
-------

JDK 11 JRE fails to create javascript Script-Engine for tag policies containing script conditions


Diffs (updated)
-----

  agents-common/src/main/java/org/apache/ranger/plugin/util/ScriptEngineUtil.java 79a702a8f 
  ranger-plugin-classloader/src/main/java/org/apache/ranger/plugin/classloader/RangerPluginClassLoader.java 7ed776ecb 


Diff: https://reviews.apache.org/r/74007/diff/3/

Changes: https://reviews.apache.org/r/74007/diff/2-3/


Testing
-------

Tested with JDK11. Passes all unit tests.


Thanks,

Abhay Kulkarni


Re: Review Request 74007: RANGER-3606: Addendum to: "remove unnecessary static members from plugin class loaders" - Cannot find plugin-class-loader for TAG service-type in JDK11

Posted by Abhay Kulkarni <ak...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74007/
-----------------------------------------------------------

(Updated June 2, 2022, 3:02 p.m.)


Review request for ranger, Madhan Neethiraj and Ramesh Mani.


Changes
-------

Updated to address review comment


Bugs: RANGER-3606
    https://issues.apache.org/jira/browse/RANGER-3606


Repository: ranger


Description
-------

JDK 11 JRE fails to create javascript Script-Engine for tag policies containing script conditions


Diffs (updated)
-----

  agents-common/src/main/java/org/apache/ranger/plugin/util/ScriptEngineUtil.java 79a702a8f 
  ranger-plugin-classloader/src/main/java/org/apache/ranger/plugin/classloader/RangerPluginClassLoader.java 7ed776ecb 


Diff: https://reviews.apache.org/r/74007/diff/2/

Changes: https://reviews.apache.org/r/74007/diff/1-2/


Testing
-------

Tested with JDK11. Passes all unit tests.


Thanks,

Abhay Kulkarni


Re: Review Request 74007: RANGER-3606: Addendum to: "remove unnecessary static members from plugin class loaders" - Cannot find plugin-class-loader for TAG service-type in JDK11

Posted by Madhan Neethiraj <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74007/#review224475
-----------------------------------------------------------




ranger-plugin-classloader/src/main/java/org/apache/ranger/plugin/classloader/RangerPluginClassLoader.java
Lines 59 (patched)
<https://reviews.apache.org/r/74007/#comment313247>

    pluginType will be null here for the flow starting in ResourceMatcher constructor. In this case, returning null here may not be correct. Please review.


- Madhan Neethiraj


On June 1, 2022, 8:46 p.m., Abhay Kulkarni wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74007/
> -----------------------------------------------------------
> 
> (Updated June 1, 2022, 8:46 p.m.)
> 
> 
> Review request for ranger, Madhan Neethiraj and Ramesh Mani.
> 
> 
> Bugs: RANGER-3606
>     https://issues.apache.org/jira/browse/RANGER-3606
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> JDK 11 JRE fails to create javascript Script-Engine for tag policies containing script conditions
> 
> 
> Diffs
> -----
> 
>   agents-common/src/main/java/org/apache/ranger/plugin/util/ScriptEngineUtil.java 79a702a8f 
>   ranger-plugin-classloader/src/main/java/org/apache/ranger/plugin/classloader/RangerPluginClassLoader.java 7ed776ecb 
> 
> 
> Diff: https://reviews.apache.org/r/74007/diff/1/
> 
> 
> Testing
> -------
> 
> Tested with JDK11. Passes all unit tests.
> 
> 
> Thanks,
> 
> Abhay Kulkarni
> 
>