apache/iceberg · warning

Failed to notify event listeners

Error message

Failed to notify event listeners

What it means

After a snapshot commit completes, SnapshotProducer.commit() fires listener events (e.g. commit metrics/reporting callbacks). If notifyListeners() throws any Throwable, it is caught and logged as this warning. The commit itself has already succeeded; only event notification to registered listeners failed.

Solutions

  1. Inspect the attached stack trace to find which listener threw.
  2. Fix or wrap the faulty listener's onCommit handler so it does not throw.
  3. Guard external calls inside listeners (timeouts, retries) so monitoring outages don't produce warnings on every commit.
  4. If the listener is unnecessary, deregister it.

Example fix

// before
Events.listeners().add(listener -> { metricsClient.post(listener); }); // throws on outage
// after
Events.listeners().add(listener -> {
  try { metricsClient.post(listener); } catch (Exception e) { log.warn("metrics post failed", e); }
});
Defensive patterns

Strategy: try-catch

Try / catch

try {
  table.newAppend().appendFile(file).commit();
} catch (Throwable t) {
  LOG.warn("commit succeeded but event notification failed; verify listeners", t);
}

Prevention

When it happens

Trigger: A registered Events.Listener (via org.apache.iceberg.events.Events) throws during a commit callback, or updateEvent()/metrics construction fails inside notifyListeners during commit().

Common situations: Custom listener implementations with bugs (NPEs, downstream HTTP calls failing); listeners that do network reporting to monitoring systems that are down; listener code incompatible with the event summary shape.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/be84db3613419f05. Report an issue: GitHub.

Appendix: source

Thrown at core/src/main/java/org/apache/iceberg/SnapshotProducer.java:568

              deleteFile(manifestList);
            }
          }
        } else {
          // saved may not be present if the latest metadata couldn't be loaded due to eventual
          // consistency problems in refresh. in that case, don't clean up.
          LOG.warn("Failed to load committed snapshot, skipping manifest clean-up");
        }
      } catch (Throwable e) {
        LOG.warn(
            "Failed to load committed table metadata or during cleanup, skipping further cleanup",
            e);
      }
    }

    try {
      notifyListeners();
    } catch (Throwable e) {
      LOG.warn("Failed to notify event listeners", e);
    }
  }

  private void notifyListeners() {
    try {
      Object event = updateEvent();
      if (event != null) {
        Listeners.notifyAll(event);

        if (event instanceof CreateSnapshotEvent) {
          CreateSnapshotEvent createSnapshotEvent = (CreateSnapshotEvent) event;

          reporter.report(
              ImmutableCommitReport.builder()
                  .tableName(createSnapshotEvent.tableName())
                  .snapshotId(createSnapshotEvent.snapshotId())
                  .operation(createSnapshotEvent.operation())
                  .sequenceNumber(createSnapshotEvent.sequenceNumber())

View on GitHub (pinned to 86d9c8fc54)