You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: prevent CPU runaway in HttpNodesStatsAction JSON parsing (#18)
Three parse methods introduced in #14 were missing `parser.nextToken()`
before calling `consumeObject()` or sub-parse methods when the current
token was START_OBJECT. This caused `consumeObject()` to consume tokens
beyond its scope (including sibling fields), corrupting the parser state
and eventually leading to an infinite loop at EOF — spinning all eshttp
threads at 100% CPU each.
Fixes:
- Add `parser.nextToken()` in parseSearchBackpressureStats,
parseTaskCancellationStats, and parseSearchPipelineStats
- Add null-token (EOF) guards in fromXContent, parseNodes,
parseNodeStats, and consumeObject to throw IOException instead of
spinning
- Add START_ARRAY handling in consumeObject
- Remove orphan `new ArrayList<>()` in parseNodeStats
Tests: add 61 unit tests covering token boundary verification, field
ordering, multiple nodes, partial sub-fields, deeply nested structures,
truncated JSON, and concurrent parsing.
0 commit comments