This is an automated email from the ASF dual-hosted git repository.

dongjoon-hyun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/spark-kubernetes-operator.git


The following commit(s) were added to refs/heads/main by this push:
     new ccdeff0  [SPARK-57968] Use virtual threads for `SentinelManager` 
scheduled executor
ccdeff0 is described below

commit ccdeff0a592d2cad6ada258fcfc6b6443197bb7b
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Mon Jul 6 11:54:33 2026 -0700

    [SPARK-57968] Use virtual threads for `SentinelManager` scheduled executor
    
    ### What changes were proposed in this pull request?
    
    This PR aims to use virtual threads for the `SentinelManager` scheduled 
executor by providing a virtual thread factory.
    
    ### Why are the changes needed?
    
    - The sentinel health-check workers spend most of their time on Kubernetes 
API calls (network I/O), which is an ideal workload for virtual threads.
    
    - In addition, the worker threads now have meaningful names (`sentinel-0`, 
`sentinel-1`, ...) instead of the anonymous default (`pool-N-thread-M`), which 
helps thread-dump analysis.
    
    - Note on behavior change: the workers change from non-daemon platform 
threads to daemon virtual threads (virtual threads are always daemon). This 
does not affect JVM liveness in practice because the operator process is kept 
alive by the `com.sun.net.httpserver` dispatcher thread (non-daemon) and the 
Java Operator SDK threads.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Pass the CIs.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    Generated-by: Claude Fable 5
    
    Closes #747 from dongjoon-hyun/SPARK-57968.
    
    Authored-by: Dongjoon Hyun <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 .../apache/spark/k8s/operator/metrics/healthcheck/SentinelManager.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/spark-operator/src/main/java/org/apache/spark/k8s/operator/metrics/healthcheck/SentinelManager.java
 
b/spark-operator/src/main/java/org/apache/spark/k8s/operator/metrics/healthcheck/SentinelManager.java
index d161beb..d1d66a8 100644
--- 
a/spark-operator/src/main/java/org/apache/spark/k8s/operator/metrics/healthcheck/SentinelManager.java
+++ 
b/spark-operator/src/main/java/org/apache/spark/k8s/operator/metrics/healthcheck/SentinelManager.java
@@ -54,7 +54,8 @@ public class SentinelManager<CR extends BaseResource<?, ?, ?, 
?, ?>> {
 
   private final ScheduledExecutorService executorService =
       Executors.newScheduledThreadPool(
-          SparkOperatorConf.SENTINEL_EXECUTOR_SERVICE_POOL_SIZE.getValue());
+          SparkOperatorConf.SENTINEL_EXECUTOR_SERVICE_POOL_SIZE.getValue(),
+          Thread.ofVirtual().name("sentinel-", 0).factory());
 
   /**
    * Checks if a given resource is a sentinel resource.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to