Skip to content

unlimited number of off-heap buffers created from IntermediateProcessingPool #5319

@himanshug

Description

@himanshug

Intermediate Processing Pool (powered by StupidPool ) has no limit on how many objects can be constructed. It is usually fine for historical nodes where concurrency is limited by druid.processing.numThreads .

However, at broker, when nested groupBy queries come.. they each need at least one buffer to process the outer query.
It is definitely not accounted in GroupBy-v1 implementation and even in GroupBy-v2 it does not seem to be taken care of.
As a result, when enough nested groupBy queries are sent to Broker, they result in creating enough off-heap "intermediate processing buffers" to bring the host to OOM and sometimes crashing the host.
( Above scenario happened with a user using GroupBy-v1 queries, however I haven't verified things yet. Comment about GroupBy-v2 having similar problem is purely a feel from quick code read in GroupByStrategyV2.prepareResources(..))

I am considering a configurable upper limit on "Intermediate Processing Pool", it would fail if more objects are asked out of it than configured upper limit. That would ensure that an overall limit is imposed irrespective of bugs or no limits in specific query implementations.
That would fail queries in the worst case but save host from going OOM and resulting outage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions