Skip to content
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

Set large StreamReadConstraints.maxStringLength for IR parsing only #354

Closed
wants to merge 1 commit into from

Conversation

jmarshall
Copy link

Enlarge the maxStringLength just before parsing the (perhaps huge!) IR and reset it to the default immediately afterwards.

If this code is multithreaded and other threads also parse JSON, there is a race condition here. It would be better to construct a bespoke JsonFactory to parse this IR, but expressing that while satisfying the type checker requires more Scala knowledge than we have.

Enlarge the maxStringLength just before parsing the (perhaps huge!) IR
and reset it to the default immediately afterwards.

If this code is multithreaded and other threads also parse JSON, there
is a race condition here. It would be better to construct a bespoke
JsonFactory to parse this IR, but expressing that while satisfying the
type checker requires more Scala knowledge than we have.
@jmarshall jmarshall requested review from ckrishk and vivbak December 9, 2024 21:29
Copy link

@vivbak vivbak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved as much as I can without scala knowledge, and acknowledging the urgency of the change.

@jmarshall
Copy link
Author

This turns out to be a red herring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants