-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use JSON as the wire format in Gearman jobs #1931
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sevein
force-pushed
the
dev/issue-1673-gearman-json-encoding
branch
from
April 23, 2024 04:09
e4b271b
to
fcde702
Compare
sevein
added
the
AMAUAT
Issues relating to the improvement of the AM Automated Acceptance tests
label
Apr 23, 2024
sevein
force-pushed
the
dev/issue-1673-gearman-json-encoding
branch
from
April 23, 2024 11:43
4cef34f
to
64bcdcd
Compare
sevein
added
AMAUAT
Issues relating to the improvement of the AM Automated Acceptance tests
and removed
AMAUAT
Issues relating to the improvement of the AM Automated Acceptance tests
labels
Apr 23, 2024
sevein
added
AMAUAT
Issues relating to the improvement of the AM Automated Acceptance tests
and removed
AMAUAT
Issues relating to the improvement of the AM Automated Acceptance tests
labels
Apr 23, 2024
sevein
force-pushed
the
dev/issue-1673-gearman-json-encoding
branch
2 times, most recently
from
April 25, 2024 18:36
3cc2774
to
e91a496
Compare
sevein
added
the
AMAUAT
Issues relating to the improvement of the AM Automated Acceptance tests
label
Apr 25, 2024
sevein
added
AMAUAT
Issues relating to the improvement of the AM Automated Acceptance tests
and removed
AMAUAT
Issues relating to the improvement of the AM Automated Acceptance tests
labels
Apr 27, 2024
replaceafill
approved these changes
May 24, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great @sevein, thank you!
I think this makes the interaction with Gearman clearer and easier to debug 🙇 and I like that the use of orjson
is nicely abstracted in a single module.
orjson is significantly faster and comes with native serialization of some types like datetime or UUID.
This commit modifies the MCPServer to encode the `createdDate` of tasks using `datetime` which is natively supported by our JSONDataEncoder. The conversion to the METS-compliant format now occurs during the decoding process on the client side. This change ensures consistent use of RFC 3339 format across all communications.
sevein
force-pushed
the
dev/issue-1673-gearman-json-encoding
branch
from
May 24, 2024 15:40
02cf944
to
11c72fa
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request replaces all uses of
pickle
withjson
. The use ofpickle
was introduced back in 2011 when MCP was integrated with Gearman due to its ability to round-trip Python objects, at the cost of lower security. However, apart fromdatetime.datetime
anduuid.UUID
, we are not encoding any complex structures that cannot be easily represented in JSON.Please notice that the use of
orjson
was an afterthought and that's why it was submitted as an extra commit.orjson
is significantly faster compared to the standard libraryjson
module, being faster than pickle protocol=0 that we were using previously. It also supports native serialization of datetime and UUID objects.Fixes archivematica/Issues#1673.