morningman opened a new issue #6057:
URL: https://github.com/apache/incubator-doris/issues/6057


   **Describe the bug**
   See the stack of FE, all routine load thread blocks like:
   ```
   "doris-mysql-nio-pool-35" #1037 daemon prio=5 os_prio=0 cpu=152.99ms 
elapsed=67090.75s tid=0x00007fc360003800 nid=0xac5b waiting on condition  
[0x00007fc1fb7f5000]
      java.lang.Thread.State: WAITING (parking)
           at jdk.internal.misc.Unsafe.park([email protected]/Native Method)
           - parking to wait for  <0x000000068ac10400> (a 
java.util.concurrent.locks.ReentrantReadWriteLock$FairSync)
           at 
java.util.concurrent.locks.LockSupport.park([email protected]/LockSupport.java:194)
           at 
java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt([email protected]/AbstractQueuedSynchronizer.java:885)
           at 
java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireShared([email protected]/AbstractQueuedSynchronizer.java:1009)
           at 
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireShared([email protected]/AbstractQueuedSynchronizer.java:1324)
           at 
java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.lock([email protected]/ReentrantReadWriteLock.java:738)
           at 
org.apache.doris.load.routineload.RoutineLoadJob.readLock(RoutineLoadJob.java:387)
           at 
org.apache.doris.load.routineload.RoutineLoadJob.getShowInfo(RoutineLoadJob.java:1289)
           at 
org.apache.doris.qe.ShowExecutor.handleShowRoutineLoad(ShowExecutor.java:1185)
           at org.apache.doris.qe.ShowExecutor.execute(ShowExecutor.java:232)
           at 
org.apache.doris.qe.StmtExecutor.handleShow(StmtExecutor.java:1452)
           at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:388)
           at org.apache.doris.qe.StmtExecutor.execute(StmtExecutor.java:288)
           at 
org.apache.doris.qe.ConnectProcessor.handleQuery(ConnectProcessor.java:206)
           at 
org.apache.doris.qe.ConnectProcessor.dispatch(ConnectProcessor.java:344)
           at 
org.apache.doris.qe.ConnectProcessor.processOnce(ConnectProcessor.java:545)
           at 
org.apache.doris.mysql.nio.ReadListener.lambda$handleEvent$0(ReadListener.java:50)
           at 
org.apache.doris.mysql.nio.ReadListener$$Lambda$676/0x0000000800770c40.run(Unknown
 Source)
           at 
java.util.concurrent.ThreadPoolExecutor.runWorker([email protected]/ThreadPoolExecutor.java:1128)
           at 
java.util.concurrent.ThreadPoolExecutor$Worker.run([email protected]/ThreadPoolExecutor.java:628)
           at java.lang.Thread.run([email protected]/Thread.java:834)
   ```
   
   This is because:
   
   when aborting a task of a routine load job, the txn will do following step:
   
   1. beforeStateTransform()
   2. abortTxn();
   3. afterStateTransform();
   
   In beforeStateTransform(), it will lock the write lock of the routine load 
job, and in afterStateTransform(), it will be unlocked.
   
   when locking, the routine load job object is got from 
`TxnStateCallbackFactory` via `callbackId`.
   But the routine load job object may be removed from 
`TxnStateCallbackFactory` at step 2.
   So in step 3, we can not get routine load job object from 
`TxnStateCallbackFactory`, so that we can not release the lock of the job.
   
   


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

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to