mirror of https://github.com/apache/druid.git
MetricsModule: inject DataSourceTaskIdHolder early (#16140)
* Explicitly bind ServiceStatusMonitor * Correct fix
This commit is contained in:
parent
352902156a
commit
c72e69a8c8
|
@ -111,7 +111,10 @@ public class MetricsModule implements Module
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
List<Monitor> monitors = new ArrayList<>();
|
List<Monitor> monitors = new ArrayList<>();
|
||||||
|
// HACK: when ServiceStatusMonitor is the first to be loaded, it introduces a circular dependency between
|
||||||
|
// CliPeon.runTask and CliPeon.getDataSourceFromTask/CliPeon.getTaskIDFromTask. The reason for this is unclear
|
||||||
|
// but by injecting DataSourceTaskIdHolder early this cycle is avoided.
|
||||||
|
injector.getInstance(DataSourceTaskIdHolder.class);
|
||||||
for (Class<? extends Monitor> monitorClass : Iterables.concat(monitorsConfig.getMonitors(), monitorSet)) {
|
for (Class<? extends Monitor> monitorClass : Iterables.concat(monitorsConfig.getMonitors(), monitorSet)) {
|
||||||
monitors.add(injector.getInstance(monitorClass));
|
monitors.add(injector.getInstance(monitorClass));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue