You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/04/28 08:33:05 UTC
[GitHub] [iotdb] choubenson commented on pull request #5693: [IOTDB-3018] Fix compation bugs on handling deleted target file and service shutdown deadlock
choubenson commented on PR #5693:
URL: https://github.com/apache/iotdb/pull/5693#issuecomment-1111901493
> > The third bug described in [IOTDB-3018](https://issues.apache.org/jira/browse/IOTDB-3018) my understanding after looking at the screenshot is that the main thread called stop, locked the CompactionTaskManager object with a synchronized block, while compaction thread needs to acquire the synchronized lock to submit sub compaction threads, which leads to the occurrence of deadlock. I don't know if it's the same bug as I understand, if so this bug has being fixed in [IOTDB-2966](https://github.com/apache/iotdb/pull/5610). It seems that CI is deadlocked?
>
> The deadlock happens in:
>
> 1. The main thread receives the kill signal and call the CompactionTaskManager.stop();
> 2. CompactionTaskManager.stop() synchronizes itself, and call the taskExecutionPool.shutdown(), which will send Interrupt to all the running threads. And it calls the `waitTermination()`, which loops infinitely until the pool is terminated.
> **Note that now the lock is being held by the main thread until all the tasks are finished.**
> 3. Now supposing we have 1 compaction task running, it breaks by the InterruptException, and calls ` CompactionTaskManager.getInstance().removeRunningTaskFuture(this);` in the finally block.
> 4. `removeRunningTaskFuture` also wants to acquire the lock of CompactionTaskManager, however it's already locked in 1. Here a dead lock happens.
>
> So I think this is another deadlock scenario other than the test case.
Got it, thanks. :)
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org