)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"50e4c6869c7f7faa4ad36eb190953be8616bd859","unresolved":true,"context_lines":[{"line_number":10,"context_line":"Seen good effect on tmpfs on Linux and apfs on OS X; ext4 on Linux bumps"},{"line_number":11,"context_line":"into trouble in some crypto tests, though, as there\u0027s a cap on overall"},{"line_number":12,"context_line":"xattr size, regardless of how we try to split it up across keys."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I0314e9b78449cb71d7700663520c4ddf030ec047"},{"line_number":15,"context_line":"Signed-off-by: Tim Burke \u003ctim.burke@gmail.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5834c3e9_ca8c7927","line":13,"updated":"2026-01-21 14:54:40.000000000","message":"It\u0027d be worth adding a related-change linking to Ie22db08ac0050eda693de4c30d4bc0d620e7f7d4","commit_id":"99e0914b957c3481c7f323caa4d940be22e88ccd"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"b8b449022651807d4718c35a1834c147061dd68d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"287f4022_080d800b","updated":"2025-10-01 17:20:52.000000000","message":"FWIW, all unit tests pass if we stop with the XFS tempdir in the gate: https://review.opendev.org/c/openstack/swift/+/962695\n\nThey do skip a test, though (hence the DNM on the patch):\n```\nSKIPPED [1] test/unit/common/middleware/crypto/test_encryption.py:626: Large xattrs not supported in `/tmp`. Skipping test\n```","commit_id":"6996486497978dc591926877452f62b96adb8940"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"51dc848c3827f9220f7aad876d087bc212f7bdd7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"fbd5815b_7e9eb29a","updated":"2026-01-21 14:53:40.000000000","message":"I cannot functionally validate this because on my MACOS I do NOT see any tests skipped due to lack of xattr support:\non master:\n```\npytest ./test/unit\n\n1 failed, 9932 passed, 54 skipped, 62 warnings in 1276.01s (0:21:16)\n```\n\nwith this patch:\n```\npytest ./test/unit\n\n1 failed, 9934 passed, 54 skipped, 62 warnings in 1162.35s (0:19:22)\n```\n\nFWIW the tests I see skip on macos are:\n```\nSKIPPED [1] test/unit/common/test_linkat.py:41: Requires O_TMPFILE support in TMPDIR\nSKIPPED [1] test/unit/common/test_linkat.py:80: Requires O_TMPFILE support in TMPDIR\nSKIPPED [1] test/unit/common/test_splice.py:71: splice not available\nSKIPPED [1] test/unit/common/test_splice.py:160: splice not available\nSKIPPED [1] test/unit/common/test_splice.py:127: splice not available\nSKIPPED [1] test/unit/common/test_splice.py:63: splice not available\nSKIPPED [1] test/unit/common/test_splice.py:143: splice not available\nSKIPPED [1] test/unit/common/test_splice.py:88: splice not available\nSKIPPED [1] test/unit/common/test_splice.py:108: splice not available\nSKIPPED [1] test/unit/common/test_splice.py:77: splice not available\nSKIPPED [1] test/unit/common/test_splice.py:176: splice not available\nSKIPPED [1] test/unit/common/test_splice.py:182: splice not available\nSKIPPED [1] test/unit/common/test_splice.py:218: tee not available\nSKIPPED [1] test/unit/common/test_splice.py:261: tee not available\nSKIPPED [1] test/unit/common/test_splice.py:235: tee not available\nSKIPPED [1] test/unit/common/test_splice.py:248: tee not available\nSKIPPED [1] test/unit/common/test_splice.py:224: tee not available\nSKIPPED [1] test/unit/common/test_splice.py:277: tee not available\nSKIPPED [1] test/unit/common/test_splice.py:283: tee not available\nSKIPPED [1] test/unit/common/test_utils.py:2825: get_ppid can only be functionally tested on Linux\nSKIPPED [1] test/unit/common/test_utils.py:2164: Requires O_TMPFILE support in TMPDIR\nSKIPPED [1] test/unit/common/test_utils.py:2183: Requires O_TMPFILE support in TMPDIR\nSKIPPED [1] test/unit/common/test_utils.py:2225: Requires O_TMPFILE support in TMPDIR\nSKIPPED [1] test/unit/common/test_utils.py:2564: pkg_resources loading is only available on python 3.7 and earlier\nSKIPPED [1] test/unit/common/test_utils.py:7900: utils._sys_fallocate not available\nSKIPPED [1] test/unit/common/utils/test_checksum.py:92: No kernel CRC32C\nSKIPPED [1] test/unit/common/utils/test_checksum.py:165: No kernel CRC32C\nSKIPPED [1] test/unit/common/utils/test_checksum.py:149: No kernel CRC32C\nSKIPPED [1] test/unit/common/utils/test_checksum.py:137: No kernel CRC32C\nSKIPPED [1] test/unit/common/utils/test_checksum.py:113: No kernel CRC32C\nSKIPPED [1] test/unit/common/utils/test_checksum.py:125: No kernel CRC32C\nSKIPPED [1] test/unit/common/utils/test_checksum.py:99: No kernel CRC32C\nSKIPPED [1] test/unit/common/utils/test_libc.py:57: Swift doesn\u0027t support ionice priority for arm64 64bit\nSKIPPED [2] test/unit/obj/test_diskfile.py:6256: Requires O_TMPFILE support in TMPDIR\nSKIPPED [2] test/unit/obj/test_diskfile.py:6204: Requires O_TMPFILE support in TMPDIR\nSKIPPED [2] test/unit/obj/test_diskfile.py:6185: Requires O_TMPFILE support in TMPDIR\nSKIPPED [2] test/unit/obj/test_diskfile.py:6235: Requires O_TMPFILE support in TMPDIR\nSKIPPED [2] test/unit/obj/test_diskfile.py:6045: zero-copy support is missing\nSKIPPED [2] test/unit/obj/test_diskfile.py:6023: zero-copy support is missing\nSKIPPED [2] test/unit/obj/test_diskfile.py:5988: zero-copy support is missing\nSKIPPED [2] test/unit/obj/test_diskfile.py:6008: zero-copy support is missing\nSKIPPED [1] test/unit/obj/test_server.py:9190: Skipped\nSKIPPED [1] test/unit/obj/test_server.py:10579: zero-copy support is missing\nSKIPPED [1] test/unit/obj/test_server.py:10595: zero-copy support is missing\nSKIPPED [1] test/unit/obj/test_server.py:10614: zero-copy support is missing\nSKIPPED [1] test/unit/obj/test_server.py:10645: zero-copy support is missing\n```","commit_id":"99e0914b957c3481c7f323caa4d940be22e88ccd"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f30fddeef1910c4b0af96a34231a23e9c9645d64","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"e9bed2e3_b3a4a075","in_reply_to":"fbd5815b_7e9eb29a","updated":"2026-02-03 18:08:04.000000000","message":"\u003e on my MACOS I do NOT see any tests skipped due to lack of xattr support\n\nOh, you\u0027re right -- it\u0027s all linux-kernel-ly stuff causing the skips. There\u0027s just that stupid\n```\nFAILED test/unit/container/test_replicator.py::TestReplicatorSync::test_replication_rsync_then_merge_aborts_after_merge_sharded - sqlite3.DatabaseError: Quarantined /var/folders/ql/rh2f23bn56g8...\n```\nthat passes when I just run the single file. (Or even the whole directory!)\n\nI\u0027ll update the commit message to just call out tmpfs; that\u0027s the one I mostly care about.","commit_id":"99e0914b957c3481c7f323caa4d940be22e88ccd"}],"swift/obj/diskfile.py":[{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"51dc848c3827f9220f7aad876d087bc212f7bdd7","unresolved":true,"context_lines":[{"line_number":272,"context_line":"DEFAULT_XATTR_SIZE \u003d 65536"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"def write_metadata(fd, metadata, xattr_size\u003dNone):"},{"line_number":276,"context_line":"    \"\"\""},{"line_number":277,"context_line":"    Helper function to write pickled metadata for an object file."},{"line_number":278,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"2a435b87_ce3e382f","line":275,"range":{"start_line":275,"start_character":33,"end_line":275,"end_character":48},"updated":"2026-01-21 14:53:40.000000000","message":"AFAICT this kwarg was introduced for no apparent reason [*] in https://review.opendev.org/c/openstack/swift/+/139769/1/swift/obj/diskfile.py and has never been used. I suggest we remove it rather than start to maintain it. No unit tests fail if I remove it, so if we keep it we should add unit tests.\n\nIf we do remove the optional kwarg then the constant should be named XATTR_SIZE rather than DEFAULT_XATTR_SIZE.\n\n[*] I suspect Sam added it for the benchmarking he did","commit_id":"99e0914b957c3481c7f323caa4d940be22e88ccd"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f30fddeef1910c4b0af96a34231a23e9c9645d64","unresolved":false,"context_lines":[{"line_number":272,"context_line":"DEFAULT_XATTR_SIZE \u003d 65536"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"def write_metadata(fd, metadata, xattr_size\u003dNone):"},{"line_number":276,"context_line":"    \"\"\""},{"line_number":277,"context_line":"    Helper function to write pickled metadata for an object file."},{"line_number":278,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"64f7ca4b_2fbe6a7d","line":275,"range":{"start_line":275,"start_character":33,"end_line":275,"end_character":48},"in_reply_to":"2a435b87_ce3e382f","updated":"2026-02-03 18:08:04.000000000","message":"Good idea! I hadn\u0027t gone digging.","commit_id":"99e0914b957c3481c7f323caa4d940be22e88ccd"}],"test/unit/__init__.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"0b170c81866d3df182dd1091ef2f53e7e9b64d17","unresolved":false,"context_lines":[{"line_number":1345,"context_line":"    # assume the worst -- xattrs aren\u0027t supported"},{"line_number":1346,"context_line":"    supports_xattr_cached_val \u003d False"},{"line_number":1347,"context_line":""},{"line_number":1348,"context_line":"    big_val \u003d b\u0027x\u0027 * (2**16)  # more than 4k of metadata"},{"line_number":1349,"context_line":"    try:"},{"line_number":1350,"context_line":"        fd, tmppath \u003d mkstemp()"},{"line_number":1351,"context_line":"        xattr.setxattr(fd, \u0027user.swift.testing_key\u0027, big_val)"}],"source_content_type":"text/x-python","patch_set":1,"id":"f5924752_a58ba227","line":1348,"updated":"2025-10-06 01:42:19.000000000","message":"Alot more then 4k :P","commit_id":"6996486497978dc591926877452f62b96adb8940"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"0b170c81866d3df182dd1091ef2f53e7e9b64d17","unresolved":false,"context_lines":[{"line_number":1363,"context_line":"        os.close(fd)"},{"line_number":1364,"context_line":"        os.unlink(tmppath)"},{"line_number":1365,"context_line":""},{"line_number":1366,"context_line":"    smaller_val \u003d b\u0027x\u0027 * (2 ** 11)  # maybe just 2k of metadata can work?"},{"line_number":1367,"context_line":"    try:"},{"line_number":1368,"context_line":"        fd, tmppath \u003d mkstemp()"},{"line_number":1369,"context_line":"        xattr.setxattr(fd, \u0027user.swift.testing_key\u0027, smaller_val)"}],"source_content_type":"text/x-python","patch_set":1,"id":"301e4fb4_54e9da14","line":1366,"updated":"2025-10-06 01:42:19.000000000","message":"OK so this is 2k, so we never want to test the magical 4k mark? just 64k and then 2k?","commit_id":"6996486497978dc591926877452f62b96adb8940"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"0b170c81866d3df182dd1091ef2f53e7e9b64d17","unresolved":false,"context_lines":[{"line_number":1375,"context_line":"        raise"},{"line_number":1376,"context_line":"    else:"},{"line_number":1377,"context_line":"        supports_xattr_cached_val \u003d True"},{"line_number":1378,"context_line":"        diskfile.DEFAULT_XATTR_SIZE \u003d len(smaller_val)"},{"line_number":1379,"context_line":"        return True"},{"line_number":1380,"context_line":"    finally:"},{"line_number":1381,"context_line":"        # clean up the tmpfile"}],"source_content_type":"text/x-python","patch_set":1,"id":"e92c5667_55dece89","line":1378,"updated":"2025-10-06 01:42:19.000000000","message":"Ahh ok so overriding the \"constant\" (not that it is really a constant). Rather then passing it in write_metadata,  I guess that would be harder to use, esp in tests.\n\nShould we make DEFAULT_XATTR_SIZE a swift constraint so it can be changed.. or are we opening up a can of worms?","commit_id":"6996486497978dc591926877452f62b96adb8940"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"0b170c81866d3df182dd1091ef2f53e7e9b64d17","unresolved":false,"context_lines":[{"line_number":1423,"context_line":"                fd,"},{"line_number":1424,"context_line":"                \u0027user.swift.testing_key\u0027 + str(n or \u0027\u0027),"},{"line_number":1425,"context_line":"                big_val[:diskfile.DEFAULT_XATTR_SIZE])"},{"line_number":1426,"context_line":"            big_val \u003d big_val[diskfile.DEFAULT_XATTR_SIZE:]"},{"line_number":1427,"context_line":"            n +\u003d 1"},{"line_number":1428,"context_line":"    except IOError as e:"},{"line_number":1429,"context_line":"        if errno.errorcode.get(e.errno) not in ("}],"source_content_type":"text/x-python","patch_set":1,"id":"e8f91c82_228ffd62","line":1426,"updated":"2025-10-06 01:42:19.000000000","message":"Ahh clever! it\u0027ll chunk up and write it. And this will test things that have a limited space for xattr (like ext4). But now takes the DEFAULT_XATTR_SIZE into account.","commit_id":"6996486497978dc591926877452f62b96adb8940"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"51dc848c3827f9220f7aad876d087bc212f7bdd7","unresolved":true,"context_lines":[{"line_number":1415,"context_line":"    # assume the worst -- xattrs aren\u0027t supported"},{"line_number":1416,"context_line":"    supports_xattr_cached_val \u003d False"},{"line_number":1417,"context_line":""},{"line_number":1418,"context_line":"    big_val \u003d b\u0027x\u0027 * (2**16)  # more than 4k of metadata"},{"line_number":1419,"context_line":"    try:"},{"line_number":1420,"context_line":"        fd, tmppath \u003d mkstemp()"},{"line_number":1421,"context_line":"        xattr.setxattr(fd, \u0027user.swift.testing_key\u0027, big_val)"}],"source_content_type":"text/x-python","patch_set":2,"id":"a0b6544f_95d1f028","line":1418,"range":{"start_line":1418,"start_character":21,"end_line":1418,"end_character":28},"updated":"2026-01-21 14:53:40.000000000","message":"could this just use diskfile.DEFAULT_XATTR_SIZE ?","commit_id":"99e0914b957c3481c7f323caa4d940be22e88ccd"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f30fddeef1910c4b0af96a34231a23e9c9645d64","unresolved":false,"context_lines":[{"line_number":1415,"context_line":"    # assume the worst -- xattrs aren\u0027t supported"},{"line_number":1416,"context_line":"    supports_xattr_cached_val \u003d False"},{"line_number":1417,"context_line":""},{"line_number":1418,"context_line":"    big_val \u003d b\u0027x\u0027 * (2**16)  # more than 4k of metadata"},{"line_number":1419,"context_line":"    try:"},{"line_number":1420,"context_line":"        fd, tmppath \u003d mkstemp()"},{"line_number":1421,"context_line":"        xattr.setxattr(fd, \u0027user.swift.testing_key\u0027, big_val)"}],"source_content_type":"text/x-python","patch_set":2,"id":"8e9fb4d0_d8fb5687","line":1418,"range":{"start_line":1418,"start_character":21,"end_line":1418,"end_character":28},"in_reply_to":"a0b6544f_95d1f028","updated":"2026-02-03 18:08:04.000000000","message":"Done","commit_id":"99e0914b957c3481c7f323caa4d940be22e88ccd"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"51dc848c3827f9220f7aad876d087bc212f7bdd7","unresolved":true,"context_lines":[{"line_number":1445,"context_line":"        raise"},{"line_number":1446,"context_line":"    else:"},{"line_number":1447,"context_line":"        supports_xattr_cached_val \u003d True"},{"line_number":1448,"context_line":"        diskfile.DEFAULT_XATTR_SIZE \u003d len(smaller_val)"},{"line_number":1449,"context_line":"        return True"},{"line_number":1450,"context_line":"    finally:"},{"line_number":1451,"context_line":"        # clean up the tmpfile"}],"source_content_type":"text/x-python","patch_set":2,"id":"31dde74d_d5aaa30c","line":1448,"updated":"2026-01-21 14:53:40.000000000","message":"I feel uncomfortable having this quietly modify diskfile on the side. I almost want to suggest that diskfile figures out what xattr size can be handled and caches that, then the test init just checks if diskfile has succeeded. That way it\u0027d be really obvious in diskfile that the xattr size might vary with filesystem.\n\nIIUC that might also enable functional testing on ext4.","commit_id":"99e0914b957c3481c7f323caa4d940be22e88ccd"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f30fddeef1910c4b0af96a34231a23e9c9645d64","unresolved":true,"context_lines":[{"line_number":1445,"context_line":"        raise"},{"line_number":1446,"context_line":"    else:"},{"line_number":1447,"context_line":"        supports_xattr_cached_val \u003d True"},{"line_number":1448,"context_line":"        diskfile.DEFAULT_XATTR_SIZE \u003d len(smaller_val)"},{"line_number":1449,"context_line":"        return True"},{"line_number":1450,"context_line":"    finally:"},{"line_number":1451,"context_line":"        # clean up the tmpfile"}],"source_content_type":"text/x-python","patch_set":2,"id":"fbc83dd7_95ca9555","line":1448,"in_reply_to":"31dde74d_d5aaa30c","updated":"2026-02-03 18:08:04.000000000","message":"I debated about that, then figured the (almost) tests-only change would be easier to get reviewed/merged. I\u0027m not opposed to having diskfile dynamically figure it out; I hadn\u0027t realized that we used to chunk by 254. Now I\u0027m torn.\n\n\u003e IIUC that might also enable functional testing on ext4.\n\nNope -- apparently we\u0027ve got encryption tests that\u0027ll exceed the 4096 limit for ext4, so we\u0027d still need to have that `test_encryption.py` test annotated. And you can see by the failures on https://review.opendev.org/c/openstack/swift/+/962695 that we can\u0027t remove any of the CI infrastructure for getting an XFS tmpdir. 😕","commit_id":"99e0914b957c3481c7f323caa4d940be22e88ccd"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"c353b8bf17c44b2f368ffbf19cde4c77ccef5397","unresolved":true,"context_lines":[{"line_number":1445,"context_line":"        raise"},{"line_number":1446,"context_line":"    else:"},{"line_number":1447,"context_line":"        supports_xattr_cached_val \u003d True"},{"line_number":1448,"context_line":"        diskfile.DEFAULT_XATTR_SIZE \u003d len(smaller_val)"},{"line_number":1449,"context_line":"        return True"},{"line_number":1450,"context_line":"    finally:"},{"line_number":1451,"context_line":"        # clean up the tmpfile"}],"source_content_type":"text/x-python","patch_set":2,"id":"abae7653_342c79c5","line":1448,"in_reply_to":"fbc83dd7_95ca9555","updated":"2026-02-03 18:14:30.000000000","message":"\u003e I\u0027m not opposed to having diskfile dynamically figure it out\n\nActually, I take that back -- it raises too many questions:\n\n- When should we try to dynamically figure it out? On first call, or when we start getting back errors?\n- Where should the temp file for the check go? How/when will it get cleaned up if there\u0027s a crash or power failure?\n- How do we handle multiple disks having multiple filesystems?","commit_id":"99e0914b957c3481c7f323caa4d940be22e88ccd"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"51dc848c3827f9220f7aad876d087bc212f7bdd7","unresolved":true,"context_lines":[{"line_number":1483,"context_line":"    # assume the worst -- large_xattrs aren\u0027t supported"},{"line_number":1484,"context_line":"    supports_large_xattr_cached_val \u003d False"},{"line_number":1485,"context_line":""},{"line_number":1486,"context_line":"    big_val \u003d b\u0027x\u0027 * (2**16)  # more than 4k of metadata"},{"line_number":1487,"context_line":"    n \u003d 0"},{"line_number":1488,"context_line":"    try:"},{"line_number":1489,"context_line":"        fd, tmppath \u003d mkstemp()"}],"source_content_type":"text/x-python","patch_set":2,"id":"9b01778a_72bd5c03","line":1486,"range":{"start_line":1486,"start_character":32,"end_line":1486,"end_character":56},"updated":"2026-01-21 14:53:40.000000000","message":"why vague? - it is specifically DEFAULT_XATTR_SIZE","commit_id":"99e0914b957c3481c7f323caa4d940be22e88ccd"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f30fddeef1910c4b0af96a34231a23e9c9645d64","unresolved":true,"context_lines":[{"line_number":1483,"context_line":"    # assume the worst -- large_xattrs aren\u0027t supported"},{"line_number":1484,"context_line":"    supports_large_xattr_cached_val \u003d False"},{"line_number":1485,"context_line":""},{"line_number":1486,"context_line":"    big_val \u003d b\u0027x\u0027 * (2**16)  # more than 4k of metadata"},{"line_number":1487,"context_line":"    n \u003d 0"},{"line_number":1488,"context_line":"    try:"},{"line_number":1489,"context_line":"        fd, tmppath \u003d mkstemp()"}],"source_content_type":"text/x-python","patch_set":2,"id":"b0cbcc71_7d3fb31e","line":1486,"range":{"start_line":1486,"start_character":32,"end_line":1486,"end_character":56},"in_reply_to":"9b01778a_72bd5c03","updated":"2026-02-03 18:08:04.000000000","message":"True -- though I still want to use the explicit number, since the \"constant\" in diskfile may have gotten updated.","commit_id":"99e0914b957c3481c7f323caa4d940be22e88ccd"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"51dc848c3827f9220f7aad876d087bc212f7bdd7","unresolved":true,"context_lines":[{"line_number":1487,"context_line":"    n \u003d 0"},{"line_number":1488,"context_line":"    try:"},{"line_number":1489,"context_line":"        fd, tmppath \u003d mkstemp()"},{"line_number":1490,"context_line":"        # Chunk it up like we do in diskfile"},{"line_number":1491,"context_line":"        while big_val:"},{"line_number":1492,"context_line":"            xattr.setxattr("},{"line_number":1493,"context_line":"                fd,"}],"source_content_type":"text/x-python","patch_set":2,"id":"e2c55381_262c4eea","line":1490,"updated":"2026-01-21 14:53:40.000000000","message":"could this just call diskfile.write_metadata - that is the acid test right?","commit_id":"99e0914b957c3481c7f323caa4d940be22e88ccd"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f30fddeef1910c4b0af96a34231a23e9c9645d64","unresolved":true,"context_lines":[{"line_number":1487,"context_line":"    n \u003d 0"},{"line_number":1488,"context_line":"    try:"},{"line_number":1489,"context_line":"        fd, tmppath \u003d mkstemp()"},{"line_number":1490,"context_line":"        # Chunk it up like we do in diskfile"},{"line_number":1491,"context_line":"        while big_val:"},{"line_number":1492,"context_line":"            xattr.setxattr("},{"line_number":1493,"context_line":"                fd,"}],"source_content_type":"text/x-python","patch_set":2,"id":"0881226a_57935990","line":1490,"in_reply_to":"e2c55381_262c4eea","updated":"2026-02-03 18:08:04.000000000","message":"Except `write_metadata` is expecting a dict and will handle encoding that to the bytes to write down in xattrs. It\u0027ll complicate selecting our \"large\" value (Does our encoding do any sort of opportunistic compression? *Should* it?), and if we want to fiddle with the definition of \"large\" to see where/how things break down on a particular filesystem it\u0027ll be non-obvious where the *real* limit is.\n\n(Really, even what we\u0027ve got makes it non-obvious -- I\u0027m glad Sam took good notes in the commit message for https://review.opendev.org/c/openstack/swift/+/139769! I don\u0027t think I\u0027d realized there was a *combined* limit for keys and values -- the length of that `user.swift.testing_key` turns out to be important!)","commit_id":"99e0914b957c3481c7f323caa4d940be22e88ccd"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"51dc848c3827f9220f7aad876d087bc212f7bdd7","unresolved":true,"context_lines":[{"line_number":1507,"context_line":"    finally:"},{"line_number":1508,"context_line":"        # clean up the tmpfile"},{"line_number":1509,"context_line":"        os.close(fd)"},{"line_number":1510,"context_line":"        os.unlink(tmppath)"},{"line_number":1511,"context_line":""},{"line_number":1512,"context_line":""},{"line_number":1513,"context_line":"def skip_if_no_large_xattrs():"}],"source_content_type":"text/x-python","patch_set":2,"id":"89acd47a_dea5daa4","line":1510,"updated":"2026-01-21 14:53:40.000000000","message":"I think this could all be more compact with a single helper to check xattr capabiliies, for example:\n\n```\ndiff --git a/test/unit/__init__.py b/test/unit/__init__.py\nindex 5cf720287..2a0a15174 100644\n--- a/test/unit/__init__.py\n+++ b/test/unit/__init__.py\n@@ -1393,6 +1393,32 @@ def fake_ec_node_response(node_frags, policy):\n supports_xattr_cached_val \u003d None\n \n \n+def _check_xattr_size(total_size, part_size):\n+    success \u003d False\n+    n \u003d 0\n+    try:\n+        fd, tmppath \u003d mkstemp()\n+        big_val \u003d b\u0027x\u0027 * total_size\n+        while big_val:\n+            xattr.setxattr(\n+                fd,\n+                \u0027user.swift.testing_key\u0027 + str(n or \u0027\u0027),\n+                big_val[:part_size])\n+            n +\u003d 1\n+            big_val \u003d big_val[part_size:]\n+        success \u003d True\n+    except IOError as e:\n+        if errno.errorcode.get(e.errno) not in (\n+                \u0027ENOSPC\u0027, \u0027ENOTSUP\u0027, \u0027EOPNOTSUPP\u0027, \u0027ERANGE\u0027):\n+            raise\n+        # else, filesystem does not support xattr of this size;\n+        # maybe smaller can work?\n+    finally:\n+        # clean up the tmpfile\n+        os.close(fd)\n+        os.unlink(tmppath)\n+    return success\n+\n def xattr_supported_check():\n     \"\"\"\n     This check ascertains whether xattrs are supported in TMPDIR.\n@@ -1409,48 +1435,17 @@ def xattr_supported_check():\n     \"\"\"\n     global supports_xattr_cached_val\n \n-    if supports_xattr_cached_val is not None:\n-        return supports_xattr_cached_val\n-\n-    # assume the worst -- xattrs aren\u0027t supported\n-    supports_xattr_cached_val \u003d False\n+    if supports_xattr_cached_val is None:\n+        # assume the worst -- xattrs aren\u0027t supported\n+        supports_xattr_cached_val \u003d False\n+        for size in (diskfile.DEFAULT_XATTR_SIZE, 2 ** 11):\n+            if _check_xattr_size(size, size):\n+                supports_xattr_cached_val \u003d True\n+                diskfile.DEFAULT_XATTR_SIZE \u003d size\n+                break\n \n-    big_val \u003d b\u0027x\u0027 * (2**16)  # more than 4k of metadata\n-    try:\n-        fd, tmppath \u003d mkstemp()\n-        xattr.setxattr(fd, \u0027user.swift.testing_key\u0027, big_val)\n-    except IOError as e:\n-        if errno.errorcode.get(e.errno) not in (\n-                \u0027ENOSPC\u0027, \u0027ENOTSUP\u0027, \u0027EOPNOTSUPP\u0027, \u0027ERANGE\u0027):\n-            raise\n-        # else, filesystem does not support xattr of this size;\n-        # maybe smaller can work?\n-    else:\n-        supports_xattr_cached_val \u003d True\n-        return True\n-    finally:\n-        # clean up the tmpfile\n-        os.close(fd)\n-        os.unlink(tmppath)\n+    return supports_xattr_cached_val\n \n-    smaller_val \u003d b\u0027x\u0027 * (2 ** 11)  # maybe just 2k of metadata can work?\n-    try:\n-        fd, tmppath \u003d mkstemp()\n-        xattr.setxattr(fd, \u0027user.swift.testing_key\u0027, smaller_val)\n-    except IOError as e:\n-        if errno.errorcode.get(e.errno) in (\u0027ENOSPC\u0027, \u0027ENOTSUP\u0027, \u0027EOPNOTSUPP\u0027,\n-                                            \u0027ERANGE\u0027):\n-            # filesystem does not support xattr of this size\n-            return False\n-        raise\n-    else:\n-        supports_xattr_cached_val \u003d True\n-        diskfile.DEFAULT_XATTR_SIZE \u003d len(smaller_val)\n-        return True\n-    finally:\n-        # clean up the tmpfile\n-        os.close(fd)\n-        os.unlink(tmppath)\n \n \n def skip_if_no_xattrs():\n@@ -1477,37 +1472,12 @@ def large_xattr_supported_check():\n     \"\"\"\n     global supports_large_xattr_cached_val\n \n-    if supports_large_xattr_cached_val is not None:\n-        return supports_large_xattr_cached_val\n+    if supports_large_xattr_cached_val is None:\n+        # assume the worst -- large_xattrs aren\u0027t supported\n+        supports_large_xattr_cached_val \u003d _check_xattr_size(\n+            2 ** 16, diskfile.DEFAULT_XATTR_SIZE)\n \n-    # assume the worst -- large_xattrs aren\u0027t supported\n-    supports_large_xattr_cached_val \u003d False\n-\n-    big_val \u003d b\u0027x\u0027 * (2**16)  # more than 4k of metadata\n-    n \u003d 0\n-    try:\n-        fd, tmppath \u003d mkstemp()\n-        # Chunk it up like we do in diskfile\n-        while big_val:\n-            xattr.setxattr(\n-                fd,\n-                \u0027user.swift.testing_key\u0027 + str(n or \u0027\u0027),\n-                big_val[:diskfile.DEFAULT_XATTR_SIZE])\n-            big_val \u003d big_val[diskfile.DEFAULT_XATTR_SIZE:]\n-            n +\u003d 1\n-    except IOError as e:\n-        if errno.errorcode.get(e.errno) not in (\n-                \u0027ENOSPC\u0027, \u0027ENOTSUP\u0027, \u0027EOPNOTSUPP\u0027, \u0027ERANGE\u0027):\n-            raise\n-        # else, filesystem does not support aggregate xattrs of this size\n-        return False\n-    else:\n-        supports_large_xattr_cached_val \u003d True\n-        return True\n-    finally:\n-        # clean up the tmpfile\n-        os.close(fd)\n-        os.unlink(tmppath)\n+    return supports_large_xattr_cached_val\n \n \n def skip_if_no_large_xattrs():\n\n```","commit_id":"99e0914b957c3481c7f323caa4d940be22e88ccd"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f30fddeef1910c4b0af96a34231a23e9c9645d64","unresolved":false,"context_lines":[{"line_number":1507,"context_line":"    finally:"},{"line_number":1508,"context_line":"        # clean up the tmpfile"},{"line_number":1509,"context_line":"        os.close(fd)"},{"line_number":1510,"context_line":"        os.unlink(tmppath)"},{"line_number":1511,"context_line":""},{"line_number":1512,"context_line":""},{"line_number":1513,"context_line":"def skip_if_no_large_xattrs():"}],"source_content_type":"text/x-python","patch_set":2,"id":"ac1a518d_86002037","line":1510,"in_reply_to":"89acd47a_dea5daa4","updated":"2026-02-03 18:08:04.000000000","message":"Done","commit_id":"99e0914b957c3481c7f323caa4d940be22e88ccd"}]}
