You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "zwangsheng (via GitHub)" <gi...@apache.org> on 2023/04/10 08:23:12 UTC

[GitHub] [kyuubi] zwangsheng opened a new pull request, #4682: [KYUUBI #4681][Engine] Set thread `CreateSparkTimeoutChecker` daemon

zwangsheng opened a new pull request, #4682:
URL: https://github.com/apache/kyuubi/pull/4682

   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/CONTRIBUTING.html
     2. If the PR is related to an issue in https://github.com/apache/kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
   -->
   
   ### _Why are the changes needed?_
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you add a feature, you can talk about the use case of it.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   Close #4681
   
   Set `CreateSparkTimeoutChecker` in `SparkSQLEngine` daemon.
   
   ### _How was this patch tested?_
   - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
   
   - [ ] Add screenshots for manual tests if appropriate
   
   - [ ] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request
   


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] codecov-commenter commented on pull request #4682: [KYUUBI #4681][Engine] Set thread `CreateSparkTimeoutChecker` daemon

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #4682:
URL: https://github.com/apache/kyuubi/pull/4682#issuecomment-1501679717

   ## [Codecov](https://codecov.io/gh/apache/kyuubi/pull/4682?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#4682](https://codecov.io/gh/apache/kyuubi/pull/4682?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3a89acc) into [master](https://codecov.io/gh/apache/kyuubi/commit/458d92540ea0f26ec53af2ffbba2d8937bd64aea?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (458d925) will **decrease** coverage by `0.01%`.
   > The diff coverage is `71.42%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #4682      +/-   ##
   ============================================
   - Coverage     57.92%   57.91%   -0.01%     
     Complexity       13       13              
   ============================================
     Files           580      580              
     Lines         32218    32218              
     Branches       4304     4304              
   ============================================
   - Hits          18661    18659       -2     
     Misses        11762    11762              
   - Partials       1795     1797       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/kyuubi/pull/4682?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...rg/apache/kyuubi/engine/spark/SparkSQLEngine.scala](https://codecov.io/gh/apache/kyuubi/pull/4682?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9TcGFya1NRTEVuZ2luZS5zY2FsYQ==) | `68.65% <71.42%> (ø)` | |
   
   ... and [6 files with indirect coverage changes](https://codecov.io/gh/apache/kyuubi/pull/4682/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] zwangsheng commented on pull request #4682: [KYUUBI #4681][Engine] Set thread `CreateSparkTimeoutChecker` daemon

Posted by "zwangsheng (via GitHub)" <gi...@apache.org>.
zwangsheng commented on PR #4682:
URL: https://github.com/apache/kyuubi/pull/4682#issuecomment-1501546773

   CC @wForget @pan3793 @ulysses-you 


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] zwangsheng commented on pull request #4682: [KYUUBI #4681][Engine] Set thread `CreateSparkTimeoutChecker` daemon

Posted by "zwangsheng (via GitHub)" <gi...@apache.org>.
zwangsheng commented on PR #4682:
URL: https://github.com/apache/kyuubi/pull/4682#issuecomment-1502615188

   Seems `Spark On Kubernetes IT Test` fail with Resource Pending, will revert debug changes.


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] pan3793 commented on a diff in pull request #4682: [KYUUBI #4681][Engine] Set thread `CreateSparkTimeoutChecker` daemon

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #4682:
URL: https://github.com/apache/kyuubi/pull/4682#discussion_r1161585467


##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala:
##########
@@ -359,16 +359,15 @@ object SparkSQLEngine extends Logging {
 
   private def startInitTimeoutChecker(startTime: Long, timeout: Long): Unit = {
     val mainThread = Thread.currentThread()
-    new Thread(
+    ThreadUtils.newDaemonSingleThreadScheduledExecutor("CreateSparkTimeoutChecker", false).execute(

Review Comment:
   where to shutdown the executor?



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] pan3793 closed pull request #4682: [KYUUBI #4681][Engine] Set thread `CreateSparkTimeoutChecker` daemon

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 closed pull request #4682: [KYUUBI #4681][Engine] Set thread `CreateSparkTimeoutChecker` daemon
URL: https://github.com/apache/kyuubi/pull/4682


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] cxzl25 commented on a diff in pull request #4682: [KYUUBI #4681][Engine] Set thread `CreateSparkTimeoutChecker` daemon

Posted by "cxzl25 (via GitHub)" <gi...@apache.org>.
cxzl25 commented on code in PR #4682:
URL: https://github.com/apache/kyuubi/pull/4682#discussion_r1163533354


##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala:
##########
@@ -359,16 +359,16 @@ object SparkSQLEngine extends Logging {
 
   private def startInitTimeoutChecker(startTime: Long, timeout: Long): Unit = {
     val mainThread = Thread.currentThread()
-    new Thread(
-      () => {
-        while (System.currentTimeMillis() - startTime < timeout && !sparkSessionCreated.get()) {
-          Thread.sleep(500)
-        }
-        if (!sparkSessionCreated.get()) {
-          mainThread.interrupt()
-        }
-      },
-      "CreateSparkTimeoutChecker").start()
+    val checker = new Thread(() => {
+      while (System.currentTimeMillis() - startTime < timeout && !sparkSessionCreated.get()) {
+        Thread.sleep(500)
+      }
+      if (!sparkSessionCreated.get()) {
+        mainThread.interrupt()
+      }
+    })

Review Comment:
   Should we set the thread name?



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] zwangsheng commented on a diff in pull request #4682: [KYUUBI #4681][Engine] Set thread `CreateSparkTimeoutChecker` daemon

Posted by "zwangsheng (via GitHub)" <gi...@apache.org>.
zwangsheng commented on code in PR #4682:
URL: https://github.com/apache/kyuubi/pull/4682#discussion_r1163536940


##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/SparkSQLEngine.scala:
##########
@@ -359,16 +359,16 @@ object SparkSQLEngine extends Logging {
 
   private def startInitTimeoutChecker(startTime: Long, timeout: Long): Unit = {
     val mainThread = Thread.currentThread()
-    new Thread(
-      () => {
-        while (System.currentTimeMillis() - startTime < timeout && !sparkSessionCreated.get()) {
-          Thread.sleep(500)
-        }
-        if (!sparkSessionCreated.get()) {
-          mainThread.interrupt()
-        }
-      },
-      "CreateSparkTimeoutChecker").start()
+    val checker = new Thread(() => {
+      while (System.currentTimeMillis() - startTime < timeout && !sparkSessionCreated.get()) {
+        Thread.sleep(500)
+      }
+      if (!sparkSessionCreated.get()) {
+        mainThread.interrupt()
+      }
+    })

Review Comment:
   Thanks for catch this, forget to set.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] pan3793 commented on pull request #4682: [KYUUBI #4681][Engine] Set thread `CreateSparkTimeoutChecker` daemon

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on PR #4682:
URL: https://github.com/apache/kyuubi/pull/4682#issuecomment-1501612573

   IMO simply call `Thread#setDaemon(true)` before calling `Thread#start` is fine


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org