pentaho/pentaho-kettle · warning · RuntimeException

Waiting for transformation to be finished interrupted!

Error message

Waiting for transformation to be finished interrupted!

What it means

Code that waits for a transformation to finish (e.g. waitUntilFinished) polls the running flag in a loop with Thread.sleep(1). If the waiting thread is interrupted (Thread.interrupt()), the InterruptedException is rethrown as a RuntimeException with this message. It indicates the waiter was interrupted, not that the transformation failed.

Solutions

  1. Do not interrupt the thread waiting on the transformation; stop the transformation via trans.stopAll() instead
  2. Restore the interrupt status in the caller (Thread.currentThread().interrupt()) and handle gracefully
  3. Ensure executors are not shut down with shutdownNow() while transformations are awaited
  4. Use a listener (TransListener) instead of a polling wait if interruption is expected

Example fix

// before
trans.execute(args);
trans.waitUntilFinished();
// after: stop via API, not interruption
trans.execute(args);
Runtime.getRuntime().addShutdownHook(new Thread(() -> trans.stopAll()));
trans.waitUntilFinished();
Defensive patterns

Strategy: try-catch

Validate before calling

if (Thread.interrupted()) {
  throw new IllegalStateException("Cannot wait for transformation: thread already interrupted");
}

Type guard

boolean wasInterruptedWhileWaiting(RuntimeException e) {
  return "Waiting for transformation to be finished interrupted!".equals(e.getMessage()) && e.getCause() instanceof InterruptedException;
}

Try / catch

try {
  trans.waitUntilFinished();
} catch (RuntimeException e) {
  if (e.getCause() instanceof InterruptedException) {
    Thread.currentThread().interrupt();
    trans.stopAll();
  } else throw e;
}

Prevention

When it happens

Trigger: Calling trans.waitUntilFinished() (or similar polling wait) from a thread that gets interrupted - e.g. executor shutdownNow(), timeout watchdogs, or application shutdown interrupting worker threads.

Common situations: Stopping a Kettle job via Thread.interrupt(); cancelling embedded execution in an app server; JVM shutdown hooks interrupting running transformation threads.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/349feef48e86c2ad. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/Trans.java:1809

  /**
   * Waits until all RunThreads have finished.
   */
  public void waitUntilFinished() {
    try {
      if ( transFinishedBlockingQueue == null ) {
        return;
      }
      boolean wait = true;
      while ( wait ) {
        wait = transFinishedBlockingQueue.poll( 1, TimeUnit.DAYS ) == null;
        if ( wait ) {
          // poll returns immediately - this was hammering the CPU with poll checks. Added
          // a sleep to let the CPU breathe
          Thread.sleep( 1 );
        }
      }
    } catch ( InterruptedException e ) {
      throw new RuntimeException( "Waiting for transformation to be finished interrupted!", e );
    }
  }

  /**
   * Gets the number of errors that have occurred during execution of the transformation.
   *
   * @return the number of errors
   */
  public int getErrors() {
    int nrErrors = errors.get();

    if ( steps == null ) {
      return nrErrors;
    }

    for ( int i = 0; i < steps.size(); i++ ) {
      StepMetaDataCombi sid = steps.get( i );
      if ( sid.step.getErrors() != 0L ) {

View on GitHub (pinned to f3058517a1)