Skip to content

Commit 0b2c8a1

Browse files
XuanYang-cnStinkbug Agent
authored andcommitted
fix: Skip compaction when encouters permission error (zilliztech#753)
Signed-off-by: yangxuan <xuan.yang@zilliz.com>
1 parent ca11ff0 commit 0b2c8a1

File tree

1 file changed

+4
-5
lines changed
  • vectordb_bench/backend/clients/milvus

1 file changed

+4
-5
lines changed

vectordb_bench/backend/clients/milvus/milvus.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,13 @@ def wait_index():
174174
try:
175175
self.col.compact()
176176
self.col.wait_for_compaction_completed()
177-
log.info("compactation completed. waiting for the rest of index buliding.")
177+
log.info("compaction completed. waiting for the rest of index building.")
178178
except Exception as e:
179179
log.warning(f"{self.name} compact error: {e}")
180-
if hasattr(e, "code"):
181-
if e.code().name == "PERMISSION_DENIED":
182-
log.warning("Skip compact due to permission denied.")
180+
if hasattr(e, "code") and e.code().name == "PERMISSION_DENIED":
181+
log.warning("Skip compact due to permission denied.")
183182
else:
184-
raise e from e
183+
raise e from None
185184
wait_index()
186185
except Exception as e:
187186
log.warning(f"{self.name} optimize error: {e}")

0 commit comments

Comments
 (0)