apache/seatunnel · error · SeaTunnelEngineException
close event processor error
Error message
close event processor error
What it means
CoordinatorService throws this SeaTunnelEngineException when it fails to shut down the engine's EventProcessor during engine/node close. The EventProcessor dispatches engine events to registered listeners; if its close() raises any Exception, the shutdown step is aborted with this wrapping error. It indicates a failure in an event listener's cleanup, not in job processing itself.
Source
Thrown at seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/CoordinatorService.java:1348
Thread.currentThread().interrupt();
logger.info(
"Coordinator service shutdown interrupted while waiting executorService termination, continue cleanup.");
}
ResourceManager manager = resourceManager;
resourceManager = null;
if (manager != null) {
manager.close();
}
try {
EventProcessor processor = eventProcessor;
eventProcessor = null;
if (processor != null) {
processor.close();
}
} catch (Exception e) {
throw new SeaTunnelEngineException("close event processor error", e);
}
}
/** Lazy load for resource manager */
public ResourceManager getResourceManager() {
if (resourceManager == null) {
synchronized (this) {
if (resourceManager == null) {
ResourceManager manager =
new ResourceManagerFactory(nodeEngine, engineConfig)
.getResourceManager();
manager.init();
resourceManager = manager;
}
}
}
return resourceManager;
}View on GitHub (pinned to cf67b549a7)
Solutions
- Inspect the caused-by chain to find which EventListener.close() threw and fix that listener's cleanup logic.
- Wrap custom event listener close/flush logic in try-catch so it logs instead of throwing.
- Ensure shutdown is invoked only once (single shutdown hook); the processor reference is nulled before close, so a repeat close is safe.
- Retry shutdown after fixing the listener; this error does not leave the engine in an inconsistent state.
Example fix
// before: listener that throws during close
public void close() {
httpClient.post(pendingEvents); // network error propagates
}
// after: tolerate errors on shutdown path
public void close() {
try { httpClient.post(pendingEvents); }
catch (Exception e) { log.warn("failed to flush events on close", e); }
} Defensive patterns
Strategy: try-catch
Try / catch
try {
engine.close();
} catch (SeaTunnelEngineException e) {
if (e.getMessage().contains("close event processor error")) {
log.warn("event processor close failed during shutdown", e.getCause());
} else { throw e; }
} Prevention
- Wrap custom EventListener close logic in try-catch and log instead of throwing.
- Avoid blocking network I/O in event listener cleanup.
- Register a single shutdown path to avoid concurrent close.
- Keep the set of registered event listeners minimal on production nodes.
When it happens
Trigger: Engine/node shutdown (SeaTunnelServer.stop or node shutdown hook) when an EventProcessor exists and one of its registered EventListener implementations throws during EventProcessor.close().
Common situations: Custom or third-party event listeners that perform network I/O in close() without handling errors; unreachable remote event sink at shutdown time; concurrent shutdown from multiple code paths.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- Error sink is closing for stage [%s], plugin [%s]
- Failed to invoke ${clazz.getName()}.${methodName}()
- The split fetcher manager has closed.
- Failed to close Google Pub/Sub publisher
- Failed to close Google Pub/Sub subscriber
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/b911010863a8164d.
Report an issue: GitHub.