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 2021/04/15 07:09:07 UTC

[GitHub] [iotdb] mychaow commented on a change in pull request #3010: [IOTDB-1306] Fix DeadLock in MemControl module

mychaow commented on a change in pull request #3010:
URL: https://github.com/apache/iotdb/pull/3010#discussion_r613807611



##########
File path: server/src/main/java/org/apache/iotdb/db/engine/storagegroup/StorageGroupProcessor.java
##########
@@ -979,6 +983,7 @@ private boolean insertTabletToTsFileProcessor(
 
     try {
       tsFileProcessor.insertTablet(insertTabletPlan, start, end, results);
+      writeLock();

Review comment:
       Why do you add writeLock here? We have get write lock before call the function.

##########
File path: server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
##########
@@ -387,14 +385,15 @@ private void updateMemoryInfo(
     tsFileProcessorInfo.addTSPMemCost(unsealedResourceIncrement + chunkMetadataIncrement);
     if (storageGroupInfo.needToReportToSystem()) {
       SystemInfo.getInstance().reportStorageGroupStatus(storageGroupInfo);
-      try {
-        StorageEngine.blockInsertionIfReject();
-      } catch (WriteProcessRejectException e) {
-        storageGroupInfo.releaseStorageGroupMemCost(memTableIncrement);
-        tsFileProcessorInfo.releaseTSPMemCost(unsealedResourceIncrement + chunkMetadataIncrement);
-        SystemInfo.getInstance().resetStorageGroupStatus(storageGroupInfo, false);
-        throw e;
+      long startTime = System.currentTimeMillis();
+      while (SystemInfo.getInstance().isRejected()) {
+        try {
+          storageGroupInfo.getStorageGroupProcessor().rejectConditionAwait();

Review comment:
       So, if we wait to timeout, we could not return now?




-- 
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:
users@infra.apache.org