Closed sevein closed 4 months ago
I took a first stab here: dev/issue-1673-gearman-json-encoding.
Let me know what you think!
It looks like the introduction of orjson
breaks building the archivematica
Ubuntu package.
This is the log of the make
command from the debs/jammy/archivematica
of the am-packbuild
repository:
The error was initially detected by running the Archivematica DEB Packages Test workflow.
One potential solution seems to be to ignore orjson
in the dh_strip hook of debs/jammy/archivematica/debian-archivematica/rules
like this:
override_dh_strip:
dh_strip --exclude=orjson
Expected behaviour Archivematica should use a serialization format that is both safe and interoperable. Doing so would enable the development of safer and more extensible systems using tools outside the Python ecosystem, given that pickle is Python-specific.
Current behaviour Archivematica uses the pickle module for serializing and de-serializing Python objects in the following scenarios:
RPC server (MCPServer, Dashboard)
Task backend (MCPServer, MCPClient)
Access details (MCPClient, Dashboard)
In all the cases listed above, the JSON serialization format would suffice given that we don't make use of the more advance capabilities supported by the pickle module. See the comparison with JSON for more details.
Regarding performance, we are currently using pickle's protocol version 0 which is slower compared to the JSON encoder included in the standard library. If we choose to use JSON and run into performance issues down the road, orjson is a faster alternative.
Steps to reproduce N/A
Your environment (version of Archivematica, operating system, other relevant details) All known versions of Archivematica.
For Artefactual use:
Before you close this issue, you must check off the following: