Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-18411

Threads left after wrong SQL query

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0-beta1
    • None
    • clients
    • Docs Required, Release Notes Required

    Description

      After simple test

      public static void main(String[] args) {
          try (IgniteClient client = IgniteClient.builder().addresses("127.0.0.1:10800").build()) {
              try (Session ses = client.sql().createSession()) {
                  try (ResultSet rs = ses.execute(null,
                          "SELECT id, salary, key, balance from wrongName ORDER BY id")) {
                      System.out.println("SELECT DONE");
                  }
              }
              System.out.println("WORK");
          } catch (Exception e) {
              throw new RuntimeException(e);
          }
          System.out.println("DONE");
      } 

      JVM still running because of nio threads:

      Full thread dump"nioEventLoopGroup-2-1" #14 prio=10 os_prio=0 cpu=73,59ms elapsed=15,92s tid=0x00007f8d5ca78800 nid=0xb584b runnable  [0x00007f8cdbdfa000]
         java.lang.Thread.State: RUNNABLE
          at sun.nio.ch.EPoll.wait(java.base@11.0.17/Native Method)
          at sun.nio.ch.EPollSelectorImpl.doSelect(java.base@11.0.17/EPollSelectorImpl.java:120)
          at sun.nio.ch.SelectorImpl.lockAndDoSelect(java.base@11.0.17/SelectorImpl.java:124)
          - locked <0x00000006a4b640f0> (a io.netty.channel.nio.SelectedSelectionKeySet)
          - locked <0x00000006a4b2d7c0> (a sun.nio.ch.EPollSelectorImpl)
          at sun.nio.ch.SelectorImpl.select(java.base@11.0.17/SelectorImpl.java:141)
          at io.netty.channel.nio.SelectedSelectionKeySetSelector.select(SelectedSelectionKeySetSelector.java:68)
          at io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:813)
          at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:460)
          at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995)
          at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
          at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
          at java.lang.Thread.run(java.base@11.0.17/Thread.java:829)
      "main" #1 prio=5 os_prio=0 cpu=551,01ms elapsed=16,46s tid=0x00007f8d5c01a000 nid=0xb5832 waiting on condition  [0x00007f8d62e63000]
         java.lang.Thread.State: WAITING (parking)
          at jdk.internal.misc.Unsafe.park(java.base@11.0.17/Native Method)
          - parking to wait for  <0x00000006a2a92ce8> (a java.util.concurrent.CompletableFuture$Signaller)
          at java.util.concurrent.locks.LockSupport.park(java.base@11.0.17/LockSupport.java:194)
          at java.util.concurrent.CompletableFuture$Signaller.block(java.base@11.0.17/CompletableFuture.java:1796)
          at java.util.concurrent.ForkJoinPool.managedBlock(java.base@11.0.17/ForkJoinPool.java:3128)
          at java.util.concurrent.CompletableFuture.waitingGet(java.base@11.0.17/CompletableFuture.java:1823)
          at java.util.concurrent.CompletableFuture.join(java.base@11.0.17/CompletableFuture.java:2043)
          at org.apache.ignite.sql.Session.execute(Session.java:58)
          at org.apache.ignite.example.table.Check.main(Check.java:19)
      "Common-Cleaner" #11 daemon prio=8 os_prio=0 cpu=0,28ms elapsed=16,39s tid=0x00007f8d5c320800 nid=0xb5840 in Object.wait()  [0x00007f8d309d7000]
         java.lang.Thread.State: TIMED_WAITING (on object monitor)
          at java.lang.Object.wait(java.base@11.0.17/Native Method)
          - waiting on <0x00000006a37015f0> (a java.lang.ref.ReferenceQueue$Lock)
          at java.lang.ref.ReferenceQueue.remove(java.base@11.0.17/ReferenceQueue.java:155)
          - waiting to re-lock in wait() <0x00000006a37015f0> (a java.lang.ref.ReferenceQueue$Lock)
          at jdk.internal.ref.CleanerImpl.run(java.base@11.0.17/CleanerImpl.java:148)
          at java.lang.Thread.run(java.base@11.0.17/Thread.java:829)
          at jdk.internal.misc.InnocuousThread.run(java.base@11.0.17/InnocuousThread.java:161)
      "tcp-client-channel-heartbeats-785447854" #15 prio=5 os_prio=0 cpu=0,12ms elapsed=15,86s tid=0x00007f8d5ca89000 nid=0xb584d in Object.wait()  [0x00007f8cdb4f8000]
         java.lang.Thread.State: TIMED_WAITING (on object monitor)
          at java.lang.Object.wait(java.base@11.0.17/Native Method)
          - waiting on <0x00000006a2b26828> (a java.util.TaskQueue)
          at java.util.TimerThread.mainLoop(java.base@11.0.17/Timer.java:553)
          - waiting to re-lock in wait() <0x00000006a2b26828> (a java.util.TaskQueue)
          at java.util.TimerThread.run(java.base@11.0.17/Timer.java:506)
      "ForkJoinPool.commonPool-worker-3" #16 daemon prio=5 os_prio=0 cpu=0,37ms elapsed=15,85s tid=0x00007f8d5ca8e800 nid=0xb584e waiting on condition  [0x00007f8cdb3f8000]
         java.lang.Thread.State: WAITING (parking)
          at jdk.internal.misc.Unsafe.park(java.base@11.0.17/Native Method)
          - parking to wait for  <0x00000006a46ff8c0> (a java.util.concurrent.ForkJoinPool)
          at java.util.concurrent.locks.LockSupport.park(java.base@11.0.17/LockSupport.java:194)
          at java.util.concurrent.ForkJoinPool.runWorker(java.base@11.0.17/ForkJoinPool.java:1628)
          at java.util.concurrent.ForkJoinWorkerThread.run(java.base@11.0.17/ForkJoinWorkerThread.java:183)
      "Monitor Ctrl-Break" #12 daemon prio=5 os_prio=0 cpu=9,70ms elapsed=16,28s tid=0x00007f8d5c7e5800 nid=0xb5842 runnable  [0x00007f8d307d7000]
         java.lang.Thread.State: RUNNABLE
          at java.net.SocketInputStream.socketRead0(java.base@11.0.17/Native Method)
          at java.net.SocketInputStream.socketRead(java.base@11.0.17/SocketInputStream.java:115)
          at java.net.SocketInputStream.read(java.base@11.0.17/SocketInputStream.java:168)
          at java.net.SocketInputStream.read(java.base@11.0.17/SocketInputStream.java:140)
          at sun.nio.cs.StreamDecoder.readBytes(java.base@11.0.17/StreamDecoder.java:284)
          at sun.nio.cs.StreamDecoder.implRead(java.base@11.0.17/StreamDecoder.java:326)
          at sun.nio.cs.StreamDecoder.read(java.base@11.0.17/StreamDecoder.java:178)
          - locked <0x00000006a37027e0> (a java.io.InputStreamReader)
          at java.io.InputStreamReader.read(java.base@11.0.17/InputStreamReader.java:181)
          at java.io.BufferedReader.fill(java.base@11.0.17/BufferedReader.java:161)
          at java.io.BufferedReader.readLine(java.base@11.0.17/BufferedReader.java:326)
          - locked <0x00000006a37027e0> (a java.io.InputStreamReader)
          at java.io.BufferedReader.readLine(java.base@11.0.17/BufferedReader.java:392)
          at com.intellij.rt.execution.application.AppMainV2$1.run(AppMainV2.java:49)
      "Reference Handler" #2 daemon prio=10 os_prio=0 cpu=0,24ms elapsed=16,43s tid=0x00007f8d5c2f1800 nid=0xb5839 waiting on condition  [0x00007f8d44373000]
         java.lang.Thread.State: RUNNABLE
          at java.lang.ref.Reference.waitForReferencePendingList(java.base@11.0.17/Native Method)
          at java.lang.ref.Reference.processPendingReferences(java.base@11.0.17/Reference.java:241)
          at java.lang.ref.Reference$ReferenceHandler.run(java.base@11.0.17/Reference.java:213)
      "Finalizer" #3 daemon prio=8 os_prio=0 cpu=0,17ms elapsed=16,43s tid=0x00007f8d5c2f3800 nid=0xb583a in Object.wait()  [0x00007f8d44273000]
         java.lang.Thread.State: WAITING (on object monitor)
          at java.lang.Object.wait(java.base@11.0.17/Native Method)
          - waiting on <0x00000006a3703178> (a java.lang.ref.ReferenceQueue$Lock)
          at java.lang.ref.ReferenceQueue.remove(java.base@11.0.17/ReferenceQueue.java:155)
          - waiting to re-lock in wait() <0x00000006a3703178> (a java.lang.ref.ReferenceQueue$Lock)
          at java.lang.ref.ReferenceQueue.remove(java.base@11.0.17/ReferenceQueue.java:176)
          at java.lang.ref.Finalizer$FinalizerThread.run(java.base@11.0.17/Finalizer.java:170)
      "Signal Dispatcher" #4 daemon prio=9 os_prio=0 cpu=0,28ms elapsed=16,43s tid=0x00007f8d5c2fa000 nid=0xb583b runnable  [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE
      "Service Thread" #5 daemon prio=9 os_prio=0 cpu=0,07ms elapsed=16,43s tid=0x00007f8d5c2fc000 nid=0xb583c runnable  [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE
      "C2 CompilerThread0" #6 daemon prio=9 os_prio=0 cpu=466,98ms elapsed=16,43s tid=0x00007f8d5c2fe800 nid=0xb583d waiting on condition  [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE
         No compile task
      "C1 CompilerThread0" #9 daemon prio=9 os_prio=0 cpu=308,62ms elapsed=16,42s tid=0x00007f8d5c300800 nid=0xb583e waiting on condition  [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE
         No compile task
      "Sweeper thread" #10 daemon prio=9 os_prio=0 cpu=0,08ms elapsed=16,42s tid=0x00007f8d5c302800 nid=0xb583f runnable  [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE
      "Attach Listener" #17 daemon prio=9 os_prio=0 cpu=33,91ms elapsed=15,39s tid=0x00007f8d0c001000 nid=0xb5858 waiting on condition  [0x0000000000000000]
         java.lang.Thread.State: RUNNABLE
      "VM Thread" os_prio=0 cpu=6,44ms elapsed=16,43s tid=0x00007f8d5c2ee800 nid=0xb5838 runnable  
      "GC Thread#0" os_prio=0 cpu=9,76ms elapsed=16,44s tid=0x00007f8d5c033800 nid=0xb5833 runnable  
      "GC Thread#1" os_prio=0 cpu=4,88ms elapsed=16,09s tid=0x00007f8d20049000 nid=0xb5844 runnable  
      "GC Thread#2" os_prio=0 cpu=8,81ms elapsed=16,09s tid=0x00007f8d2004a800 nid=0xb5845 runnable  
      "GC Thread#3" os_prio=0 cpu=8,95ms elapsed=16,09s tid=0x00007f8d2004c000 nid=0xb5846 runnable  
      "GC Thread#4" os_prio=0 cpu=5,07ms elapsed=16,09s tid=0x00007f8d2004e000 nid=0xb5847 runnable  
      "GC Thread#5" os_prio=0 cpu=9,69ms elapsed=16,09s tid=0x00007f8d2004f800 nid=0xb5848 runnable  
      "GC Thread#6" os_prio=0 cpu=9,43ms elapsed=16,09s tid=0x00007f8d20051800 nid=0xb5849 runnable  
      "GC Thread#7" os_prio=0 cpu=0,53ms elapsed=16,09s tid=0x00007f8d20053800 nid=0xb584a runnable  
      "G1 Main Marker" os_prio=0 cpu=0,15ms elapsed=16,44s tid=0x00007f8d5c0bd000 nid=0xb5834 runnable  
      "G1 Conc#0" os_prio=0 cpu=0,05ms elapsed=16,44s tid=0x00007f8d5c0bf000 nid=0xb5835 runnable  
      "G1 Refine#0" os_prio=0 cpu=0,12ms elapsed=16,43s tid=0x00007f8d5c240000 nid=0xb5836 runnable  
      "G1 Young RemSet Sampling" os_prio=0 cpu=3,69ms elapsed=16,43s tid=0x00007f8d5c242000 nid=0xb5837 runnable  
      "VM Periodic Task Thread" os_prio=0 cpu=9,65ms elapsed=16,28s tid=0x00007f8d5c7e8000 nid=0xb5843 waiting on condition  
      JNI global refs: 18, weak refs: 0
      

      A similar problem happens on some other exceptions (class cast if I try to read long from the int field). Otherwise, threads stop as expected if the table in the example exists.

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Berkov Alexander Belyak
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: