You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@livy.apache.org by GitBox <gi...@apache.org> on 2019/07/31 09:59:47 UTC

[GitHub] [incubator-livy] fdeantoni commented on a change in pull request #188: LIVY-615: Set context path using property SERVER_BASE_PATH.

fdeantoni commented on a change in pull request #188: LIVY-615: Set context path using property SERVER_BASE_PATH.
URL: https://github.com/apache/incubator-livy/pull/188#discussion_r309136571
 
 

 ##########
 File path: server/src/main/scala/org/apache/livy/server/WebServer.scala
 ##########
 @@ -81,7 +81,10 @@ class WebServer(livyConf: LivyConf, var host: String, var port: Int) extends Log
 
   val context = new ServletContextHandler()
 
-  context.setContextPath("/")
+  private val contextPath = "/" + livyConf.get(LivyConf.SERVER_BASE_PATH).stripPrefix("/")
 
 Review comment:
   That is correct. There seems to be a mismatch between the property name SERVER_BASE_PATH and its property key "livy.ui.basePath" in the configuration file. The key implies it only changes the UI, whilst the property name assumes it changes the base path for the entire server (i.e. UI and API).
   
   When I looked through the history of this property, it seemed it was added to support reverse proxying (see [LIVY-468](https://issues.apache.org/jira/browse/LIVY-468)). Indeed, the property is used in both the WebServer and LivyServer classes, so it seems its intention was to apply them to UI and API.  
   
   Is there a need to have separate context paths for UI and API? Our deployment scenario (using reverse proxying) does not require it. If there is a need to separate the two, then perhaps a new property livy.server.basePath needs to be added. This may introduce some additional complexities though. 
   
   Perhaps a better alternative is to simply rename livy.ui.basePath to livy.server.basePath so that it is clear it changes the context path of the entire server?
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services