Skip to content

Commit

Permalink
Merge branch 'cassandra-3.0' into cassandra-3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
snazy committed Apr 3, 2017
2 parents 8862759 + f45f55b commit 5b77e04
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ public static void install()
return;
System.setSecurityManager(new ThreadAwareSecurityManager());

// The default logback configuration in conf/logback.xml allows reloading the
// configuration when the configuration file has changed (every 60 seconds by default).
// This requires logback to use file I/O APIs. But file I/O is not allowed from UDFs.
// I.e. if logback decides to check for a modification of the config file while
// executiing a sandbox thread, the UDF execution and therefore the whole request
// execution will fail with an AccessControlException.
// To work around this, a custom ReconfigureOnChangeFilter is installed, that simply
// prevents this configuration file check and possible reload of the configration,
// while executing sandboxed UDF code.
Logger l = LoggerFactory.getLogger(ThreadAwareSecurityManager.class);
ch.qos.logback.classic.Logger logbackLogger = (ch.qos.logback.classic.Logger) l;
LoggerContext ctx = logbackLogger.getLoggerContext();
Expand All @@ -99,7 +108,8 @@ public static void install()
}

/**
* The purpose of this class is
* The purpose of this class is to prevent logback from checking for config file change,
* if the current thread is executing a sandboxed thread to avoid {@link AccessControlException}s.
*/
private static class SMAwareReconfigureOnChangeFilter extends ReconfigureOnChangeFilter
{
Expand Down

0 comments on commit 5b77e04

Please sign in to comment.