>20MB Strings cannot be written (due to a novel Jackson databind default limit) #4259
Replies: 4 comments 2 replies
-
Here's how it presents in JanusGraph's logs:
|
Beta Was this translation helpful? Give feedback.
-
Thank you for the detailed analysis @criminosis ! A PR, with a test that showcases the regression, would be great! |
Beta Was this translation helpful? Give feedback.
-
@li-boxuan Got a draft PR up that demonstrates the regression that I see in my environment
From following around in git blames I discovered it seems Tinkerpop intends for for these to be configurable when they updated, I was just searching in JanusGraph code earlier for hits on ObjectMapper, but judging by the multiple nestings in the error message it seems like even with the setting being applied on the serializer something is eventually getting landed on that bounces back with the default that Tinkerpop prescribed. Any thoughts @li-boxuan? |
Beta Was this translation helpful? Give feedback.
-
@li-boxuan I pulled down the tinkerpop code and replicated my test. I was suspicious of these two lines because they weren't propagating the stream read constants behind the scenes of the object mapper they were based off of: However the test ended up passing. It was then I realized my oversight was in JG's test. Namely you can specify a different max string length in the resource file, but that resource file doesn't seem to have any bearing on the traversal being instantiated for the test case: https://github.com/JanusGraph/janusgraph/blob/master/janusgraph-server/src/test/java/org/janusgraph/graphdb/tinkerpop/gremlin/server/io/JanusGraphSONModuleIT.java#L30 So long story short the end result to resolve my issue was to create a copy of the default server config file but with the serializers un-commented out and specifying Got me wondering if it might be worth an entry on the JG docs website? Either how to restore the prior behavior, set these new stream reader limits, or even about these channel serializers in general? Maybe a section in the advanced janusgraph server configurations? |
Beta Was this translation helpful? Give feedback.
-
This PR was merged starting with Jackson 2.15.0 that added a limit to stream based parsing of JSON elements:
FasterXML/jackson-core#864
Prior to this PR it was unlimited, then was set to 1MB, then bumped to 5MB and then ultimately to 20MB.
It seems numerous other projects have been surprised by this change at least judging by the number of links to other repos throughout that PR.
A request to increase to 1GB (again the original "limit" was it was unlimited) was denied although the maintainer seems to regret putting the default in the first place:
This introduces a novel limitation for anyone writing large strings to JanusGraph. One of my tests involves writing a roughly 80MB string and it has succeeded until JanusGraph 1.0.0.
The new limit was introduced by this PR into JG:
ac67b19
While the change in JanusGraph was merged a while ago, June 13th 2023, it only has been released as part of 1.0.0, and was also pack ported into 0.6.4 by this PR so it may not be fully observed unless individuals have updated and tested this scenario.
Unless the JG team wants to incorporate a new config option to set this new max size limit on the ObjectMapper this is a removal of behavior for the latest released versions as I don't believe there's a means to modify this behavior via an environment variable to Jackson, and the code otherwise seems hardcoded to the defaults here.
To restore the prior unlimited behavior would be to do something like this:
Suggested here. I'd be happy to put up such a PR, but figured starting a dialog for if that's acceptable made sense to do first.
Beta Was this translation helpful? Give feedback.
All reactions