Improper lock usage leads to inode overflow in LockLocalStorage implementation

未關閉
#1,975 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

  • #2172 來自 @Sanjays2402 —— 已關閉,未合併

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
55/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
python
領域
cloud

研究方向

從 libcloud/storage/drivers/local.py 中本機驅動程式的 exit 方法開始,檢查 InterProcessLock 釋放鎖定後如何處理鎖定檔案名稱。使用有針對性的測試或重現來確認行為,然後驗證已釋放的鎖定檔案不再遺留在 /tmp 中,同時不影響遺失檔案的清理。

由索引模型根據 Issue 內容生成。

描述

Summary

Behaviour of fasteners.InterProcessLock is pretty weird: class creates a lockfile by provided path, if it doesn't exist, but not manage to remove it after lock is released.

It may lead to uncontrolled lockfiles spam in /tmp folder just because libcloud local driver is not removing this lockfile either.

Detailed Information

This issue encountered in cassandra-medusa v0.15 and lower, which was using apache-libcloud<3.4.0,>=3.3.0 as a dependency.

Please see https://github.com/thelastpickle/cassandra-medusa/issues/528 for more details.


Seems like the lightweight fix is to run

                with contextlib.suppress(FileNotFoundError):
                    os.remove(filename)

just right in the exit method.

主要語言
Python
星號
2.1k
分支
935
平均合併
5 天 3 小時
30 天內合併 PR
15

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

apache/libcloud 的其他 Issue

查看 apache/libcloud 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。