[bug]:TaskRuntime.stateLock and TableOptimizingProcess.lock can cause deadlocks. #4002
[bug]:TaskRuntime.stateLock and TableOptimizingProcess.lock can cause deadlocks. #4002wardlican wants to merge 1 commit intoapache:masterfrom
Conversation
|
cc @baiyangtx |
|
I am not sure if the deadlock issue still exist in the master branch. |
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@amoro.apache.org list. Thank you for your contributions. |
|
This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time. |
Why are the changes needed?
TaskRuntime.stateLock and TableOptimizingProcess.lock can cause deadlocks.This can cause tables in a certain resource group to malfunction, and OptimizerKeeper will also fail to function properly.
Close #4001.
Brief change log
Fixes Implemented:
The following fixes have been implemented:
completeTaskmethod (lines 565-577):taskRuntime.complete()(acquire and release the database lock).TableOptimizingProcess.this.lockand callacceptResult.TableOptimizingProcess.this.lockfirst, then acquire the database lock.whenCompletedcallback registration (lines 910-922 and 932-945):acceptResultwhile holding the database lock.acceptResultwithincompleteTask.cancelTasksmethod (lines 897-902):First, cancel all tasks (acquire and release the database lock).
Then call
acceptResultfor each canceled task (while holdingTableOptimizingProcess.this.lock).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 locally before making a pull request
Documentation