Classloading for Custom Authorization Extension Prematurely Deletes Classpath in Standalone

Description

In CDAP [StandaloneMain|https://github.com/cdapio/cdap/blob/d69fc4b0eb0691156e515343e0fa87e72e409471/cdap-standalone/src/main/java/io/cdap/cdap/StandaloneMain.java], the AuthorizerInstantiator unpacks the custom authorization extension JAR file into a folder in `data/tmp`. However, the AuthorizerInstantiator is actually created in the constructor for StandaloneMain, and then cleanupTempDir() is called in startup(). This causes the unpacked JAR files to be deleted immediately after instantiation.

ClassLoaders generally perform lazy loading, which means that if an authorization extension attempts to load a class after this runtime classpath is deleted, it will throw a ClassNotFoundException.

Release Notes

Fixed bug in StandaloneMain which prematurely deletes the Authorizer classpath directories.

Activity

Show:
Dennis Li
August 27, 2020, 5:37 PM
Dennis Li
August 26, 2020, 7:25 PM
Igor Strupinskiy
August 26, 2020, 5:59 PM

This could very well be what I'm experiencing in 

Fixed
Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Trishka Fernandes

Reporter

Dennis Li