RucioFileCatalog marks putAndRegister result both as successfull and failed
Due to a mistake (not declaring a fixture function in the argument list), one of our tests tried to upload a file
to LFN '/ctao.dpps.test/<function test_scope at 0x7f8256ecdc60>/gamma_prod5.simtel.zst'
This resulted in rucio rejecting the upload:
2025-11-18T11:01:46,144483Z Framework/DIRAC.Resources.Catalog.RucioFileCatalogClient WARN: Cannot bulk insert files error : RucioException("('(psycopg.errors.StringDataRightTruncation) value too long for type character varying(25)',)")
However, the returned result object has {"OK": True} and the file is present in both "Successful" and in "Failed":
INFO conftest:(unknown file):0 putFileAndRegister result for /tmp/pytest-of-dpps/pytest-3/minio_test_data_0/gamma_prod5.simtel.zst: {'OK': True, 'Value': {'Successful': {'/ctao.dpps.test/<function test_scope at 0x7f8256ecdc60>/gamma_prod5.simtel.zst': {'put': 0.30115485191345215}}, 'Failed': {'/ctao.dpps.test/<function test_scope at 0x7f8256ecdc60>/gamma_prod5.simtel.zst': {'register': {'LFN': '/ctao.dpps.test/<function test_scope at 0x7f8256ecdc60>/gamma_prod5.simtel.zst', 'PFN': 'root://x509up_u1000@rucio-storage-1:1094//rucio/ctao.dpps.test/<function test_scope at 0x7f8256ecdc60>/gamma_prod5.simtel.zst', 'Size': 17517415, 'TargetSE': 'STORAGE-1', 'GUID': 'C8B512DC-89CC-7024-0DC0-EE66E66CEC78', 'Adler': 'f5bb074d'}}}}}
Looking closer, I see now that these are particular operations. put succeeded but register failed.
Still, in this case I would have expected "OK": False.
I think "OK":True is the correct thing to do here. The method putAndRegister did not fail its execution. However, part of it failed, and this is what is reflected in the successful/failed dict. This, depending on where it is used, turns into a Failover requests for registration
Ok, if that's the general approach in DIRAC, that's fine I think then.
Naively, I would expected a partially successful operation to have Ok: False, which would still then allow you to check what succeeded and what failed.
This means mainly for us that we need to update our testing to not assume that ok: True is enough to check.