Bug #76504
closedNFS CephFS export create hits cephfs_path_is_dir but nested lru_cache never reuses CephfsClient
0%
Description
the cli command run:
_cmd_nfs_export_create_cephfs
→ create_export
→ create_cephfs_export
→ validate_cephfs_path
→ create_export_from_dict
→ validate_cephfs_path
validate_cephfs_pathis calling cephfs_path_is_dir:
def cephfs_path_is_dir(mgr, fs, path):
@functools.lru_cache(maxsize=1)
def _get_cephfs_client():
return CephfsClient(mgr)
cephfs_client = _get_cephfs_client()
since _get_cephfs_client is is defined inside cephfs_path_is_dir. This means every time cephfs_path_is_dir is called, Python creates a brand new function object for _get_cephfs_client, and applies a brand new, empty lru_cache to it. The cache never has any prior entries because it has never existed before. The result is that CephfsClient(mgr) is called unconditionally on every invocation — the cache does nothing.
That calls *2, so we have 20 extra threads - we can move that function outside and let the cache work correctly.
CephFSEarmarkResolver is probably adding 10 more threads.
SB Updated by Shweta Bhosale 7 months ago
- Pull request ID set to 68842
UB Updated by Upkeep Bot 7 months ago
- Status changed from In Progress to Resolved
- Merge Commit set to e7e72d20dac55031208c407eb2e4d3aeb12bb95b
- Fixed In set to v21.0.0-1433-ge7e72d20da
- Upkeep Timestamp set to 2026-05-14T12:42:21+00:00
SB Updated by Shweta Bhosale 2 months ago
- Status changed from Resolved to Pending Backport
- Backport set to tentacle
UB Updated by Upkeep Bot 2 months ago
- Copied to Backport #81287: tentacle: NFS CephFS export create hits cephfs_path_is_dir but nested lru_cache never reuses CephfsClient added
UB Updated by Upkeep Bot 2 months ago
- Status changed from Pending Backport to Backporting
- Upkeep Timestamp changed from 2026-05-14T12:42:21+00:00 to 2026-10-01T12:28:59+00:00
UB Updated by Upkeep Bot about 1 month ago
- Released In set to v21.2.0~475
- Upkeep Timestamp changed from 2026-10-01T12:28:59+00:00 to 2026-10-24T01:30:11+00:00
UB Updated by Upkeep Bot 30 days ago
- Released In changed from v21.2.0~475 to v21.2.0~476
- Upkeep Timestamp changed from 2026-10-24T01:30:11+00:00 to 2026-11-04T01:11:32+00:00