Skip to content

Experimental: Replace Yajl to JSON for handling JSON stream#5383

Draft
Watson1978 wants to merge 3 commits into
fluent:masterfrom
Watson1978:json-resumable-parser
Draft

Experimental: Replace Yajl to JSON for handling JSON stream#5383
Watson1978 wants to merge 3 commits into
fluent:masterfrom
Watson1978:json-resumable-parser

Conversation

@Watson1978

@Watson1978 Watson1978 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Which issue(s) this PR fixes:
Fixes #

What this PR does / why we need it:
An experiment to replace Yajl with JSON by leveraging ruby/json#994.

TODO

  • Ensure all CI tests pass
  • Check for memory leaks
    • Ensure that the memory usage of JSON::ResumableParser does not grow continuously during long-running stream parsing.
  • Test several edge cases for chunk boundaries
    • Chunk split in the middle of a Unicode escape sequence (e.g., \uXXXX).
    • Chunk split in the middle of primitive values (number, boolean, null):
      • e.g., {"key": tr and ue}
      • e.g., {"key": 12 and 34.56}
    • Parser recovery
      • Check whether the parser can successfully parse the next valid JSON chunk right after a JSON::ParserError is raised from a malformed chunk.

Docs Changes:

Release Note:

@Watson1978 Watson1978 marked this pull request as draft June 9, 2026 08:00
@Watson1978 Watson1978 force-pushed the json-resumable-parser branch 6 times, most recently from ce836b7 to aa55407 Compare June 9, 2026 09:03
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
@Watson1978 Watson1978 force-pushed the json-resumable-parser branch from aa55407 to dab88f1 Compare June 10, 2026 02:07
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
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.

1 participant