Skip to content

Commit

Permalink
MetricsModule: inject DataSourceTaskIdHolder early (apache#16140)
Browse files Browse the repository at this point in the history
* Explicitly bind ServiceStatusMonitor

* Correct fix
  • Loading branch information
arunramani authored Mar 21, 2024
1 parent 3529021 commit c72e69a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ public MonitorScheduler getMonitorScheduler(
)
{
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)) {
monitors.add(injector.getInstance(monitorClass));
}
Expand Down

0 comments on commit c72e69a

Please sign in to comment.