You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/12/02 10:24:04 UTC

[GitHub] [spark] yabola commented on a diff in pull request #38882: [SPARK-41365][CORE-UI] Stages UI page fails to load for proxy in some yarn environment

yabola commented on code in PR #38882:
URL: https://github.com/apache/spark/pull/38882#discussion_r1037993126


##########
core/src/main/scala/org/apache/spark/status/api/v1/StagesResource.scala:
##########
@@ -143,7 +148,10 @@ private[v1] class StagesResource extends BaseAppResource {
     @Context uriInfo: UriInfo):
   HashMap[String, Object] = {
     withUI { ui =>
-      val uriQueryParameters = uriInfo.getQueryParameters(true)
+      // Decode URI twice here to avoid percent-encoding twice on the query string
+      val decodeURI = URLDecoder.decode(uriInfo.getRequestUri.getRawQuery, UTF_8.name())
+      val uriQueryParameters = new ImmutableMultivaluedMap[String, String](
+        UriComponent.decodeQuery(decodeURI, true))

Review Comment:
   Not sure if decoding twice is appropriate here.
   If do not change here, the stage page can be opened, but the task sort column button cannot be clicked (locality level etc.)



##########
core/src/main/scala/org/apache/spark/status/api/v1/StagesResource.scala:
##########
@@ -204,7 +212,7 @@ private[v1] class StagesResource extends BaseAppResource {
       pageLength = queryParameters.getFirst("length").toInt
     }
     withUI(_.store.taskList(stageId, stageAttemptId, pageStartIndex, pageLength,
-      indexName(columnNameToSort), isAscendingStr.equalsIgnoreCase("asc")))
+      indexName(columnNameToSort), "asc".equalsIgnoreCase(isAscendingStr)))

Review Comment:
   `isAscendingStr` may be NPE if URI was encoded twice.
   After change here, at least the stage page can be opened now 



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org