DarkAssassinator opened a new issue, #11838:
URL: https://github.com/apache/dolphinscheduler/issues/11838

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What happened
   
   when we confige the `Timeout period` and `Failed retry interval` at the same 
time in Shell task. When shell task failed, it will submit a 
`TASK_STATE_CHANGE` TaskEvent, and then `TaskStateEventHandler` will call 
`WorkflowExecuteRunnable.taskFinished`  and remove the 
_<taskInstanceCode,TaskProcessor>_ in `activeTaskProcessorMaps`
   
![image](https://user-images.githubusercontent.com/20518339/188894300-dc652005-1d66-46e2-b3d5-334842b165e6.png)
   Then `StateWheelExecuteThread` will submit a `TASK_TIMEOUT` and a 
`TASK_RETRY` TaskEvent.
   But `TaskTimeoutStateEventHandler` will query a TaskProcessor form 
`activeTaskProcessorMaps` to process the TIMEOUT, this will casue a NPE:
   
![image](https://user-images.githubusercontent.com/20518339/188895201-9b8565e4-94fb-40b9-a38f-a7d99c1fde44.png)
   And `WorkflowExecuteRunnable` will not remove this TaskEvent if this 
taskEventHandler throw a Exception, so it keep loop, but it will no any 
update,just a infinite loop.
   
![image](https://user-images.githubusercontent.com/20518339/188895391-b58dd3a2-6a3b-4648-a024-2d583929dc39.png)
   Besides, the `WorkflowExecuteThreadPool.executeEvent` will keep print the 
`The workflow has been executed by another thread` each 100ms, because event 
count > 0
   So u can find the master log prints NPE and `The workflow has been executed 
by another thread` at the same time like crazy
   
   This bug may cause #11796 
   But I think this needs to be discussed separately
   
   
   ### What you expected to happen
   
   this process instance will stop caused by TIMEOUT, not keep a infinite loop, 
and show it's keep running.
   
   ### How to reproduce
   
   just create a shell task like the following screenshot:
   
![image](https://user-images.githubusercontent.com/20518339/188893215-b5114827-7234-4037-97c4-65854b438181.png)
   
   
   ### Anything else
   
   _No response_
   
   ### Version
   
   dev
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: 
[email protected]

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

Reply via email to