apache / apache/druid

Why SqlResource is not LazySingleton like BrokerQueryResource?

Open
#11,425 0 comments 0 reactions 0 assignees View on GitHub
Area - SQL
Dominant language
Java
Stars
14.1k
Forks
3.8k
Avg merge
2d 58m
Merged PRs (30d)
233

Description

Occasionally, I noticed SqlResource's constructor is called many times due to SqlResource is not LazySingleton.
But BrokerQueryResource is LazySingleton.
In CliBroker: `binder.bind(BrokerQueryResource.class).in(LazySingleton.class);Jerseys.addResource(binder, BrokerQueryResource.class);`
In SqlHttpModule: only `Jerseys.addResource(binder, SqlResource.class);`

Any reason why SqlResource can't be LazySingleton?

Contributor guide

Open the contributing guide

Research direction

Compare the resource bindings in CliBroker and SqlHttpModule, focusing on SqlResource, BrokerQueryResource, and the Jerseys.addResource calls named in the issue. Trace SqlResource construction and its dependencies to determine whether lazy-singleton scope is safe; done means explaining the difference and applying or documenting the appropriate lifecycle consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.