apache/druid · error · RejectedExecutionException

Dropwizard emitter Service not started.

Error message

Dropwizard emitter Service not started.

What it means

Guard thrown from DropwizardEmitter.emit() when an event arrives before start() has flipped the started flag: the emitter's reporters were never attached to the metrics registry, so the event cannot be recorded. Typically caused by registering the emitter as an extension without starting it (e.g. it was constructed but the lifecycle start phase never ran); start the emitter before feeding it events.

Solutions

  1. Call emitter.start() before emitting; verify lifecycle wiring/registration order.
  2. Ensure the emitter is not stopped while events still arrive; check for earlier startup failures.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at extensions-contrib/dropwizard-emitter/src/main/java/org/apache/druid/emitter/dropwizard/DropwizardEmitter.java:97 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/e29301e932412351. Report an issue: GitHub.

Appendix: source

Thrown at extensions-contrib/dropwizard-emitter/src/main/java/org/apache/druid/emitter/dropwizard/DropwizardEmitter.java:97


  @Override
  public void start()
  {
    final boolean alreadyStarted = started.getAndSet(true);
    if (!alreadyStarted) {
      for (DropwizardReporter reporter : reporters) {
        reporter.start(metricsRegistry);
      }
    }
  }

  @Override
  public void emit(Event event)
  {
    synchronized (started) {
      if (!started.get()) {
        throw new RejectedExecutionException("Dropwizard emitter Service not started.");
      }
    }
    if (event instanceof ServiceMetricEvent) {
      ServiceMetricEvent metricEvent = (ServiceMetricEvent) event;
      String host = metricEvent.getHost();
      String service = metricEvent.getService();
      String metric = metricEvent.getMetric();
      Map<String, Object> userDims = metricEvent.getUserDims();
      Number value = metricEvent.getValue();
      ImmutableList.Builder<String> nameBuilder = new ImmutableList.Builder<>();
      LinkedHashMap<String, String> dims = new LinkedHashMap<>();
      final DropwizardMetricSpec metricSpec = converter.addFilteredUserDims(service, metric, userDims, dims);

      if (metricSpec != null) {
        if (config.getPrefix() != null) {
          nameBuilder.add(config.getPrefix());
        }
        nameBuilder.add(StringUtils.format("metric=%s", metric));

View on GitHub (pinned to 9b90983fd2)