You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "dongjoon-hyun (via GitHub)" <gi...@apache.org> on 2026/08/25 18:42:38 UTC

[PR] [SPARK-59006][CORE] Generalize `checkAndGetSparkContext` to take a feature name [spark]

dongjoon-hyun opened a new pull request, #58287:
URL: https://github.com/apache/spark/pull/58287

   ### What changes were proposed in this pull request?
   
   This PR makes the private helper `checkAndGetSparkContext()` in `AbstractApplicationResource`
   take the name of the feature requesting the live `SparkContext`:
   
   ```scala
   private def checkAndGetSparkContext(feature: String): SparkContext = withUI { ui =>
     ui.sc.getOrElse {
       throw new ServiceUnavailable(s"$feature not available through the history server.")
     }
   }
   ```
   
   Both call sites, `threadDump` and `getTaskThreadDump`, pass `"Thread dumps"`.
   
   ### Why are the changes needed?
   
   The helper hardcoded `"Thread dumps"` in its message, so only the two thread-dump endpoints
   could use it. Any other live-only endpoint needing the live `SparkContext` had to inline its own
   `ui.sc.getOrElse { throw new ServiceUnavailable(...) }` just to get a correct message. Passing the
   feature name keeps the shared `"... not available through the history server."` wording in one place.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. The existing error messages are unchanged.
   
   ### How was this patch tested?
   
   Pass the CIs with the existing tests, including `UISeleniumSuite`, which exercises the
   thread-dump REST endpoint.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Opus 5


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


Re: [PR] [SPARK-59006][CORE] Generalize `checkAndGetSparkContext` to take a feature name [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #58287: [SPARK-59006][CORE] Generalize `checkAndGetSparkContext` to take a feature name
URL: https://github.com/apache/spark/pull/58287


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


Re: [PR] [SPARK-59006][CORE] Generalize `checkAndGetSparkContext` to take a feature name [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #58287:
URL: https://github.com/apache/spark/pull/58287#issuecomment-5415078612

   Could you review this refactoring PR, @peter-toth ? I'm generalizing this API in order to reuse for SPARK-58924 (Graceful Application Suspend and Resume Framework).


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


Re: [PR] [SPARK-59006][CORE] Generalize `checkAndGetSparkContext` to take a feature name [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #58287:
URL: https://github.com/apache/spark/pull/58287#issuecomment-5417100493

   **Merge Summary:**
   - merged into master https://github.com/apache/spark/commit/dab94988b5a2131a17319f47b7b774257ab48b8b
   - merged into branch-4.x https://github.com/apache/spark/commit/b4ecb1acca7903fbce6d66ae072a34eb631f1345
   
   *Posted by `merge_spark_pr.py`*


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


Re: [PR] [SPARK-59006][CORE] Generalize `checkAndGetSparkContext` to take a feature name [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #58287:
URL: https://github.com/apache/spark/pull/58287#issuecomment-5415101142

   Thank you so much, @peter-toth !


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


Re: [PR] [SPARK-59006][CORE] Generalize `checkAndGetSparkContext` to take a feature name [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun commented on PR #58287:
URL: https://github.com/apache/spark/pull/58287#issuecomment-5417094709

   All tests passed.


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