pentaho/pentaho-kettle · warning · KettleJobException

Interrupted during a retry

Error message

Interrupted during a retry 

What it means

During login()'s retry loop, the Thread.sleep(delayBetweenEachAttempts) between attempts can throw InterruptedException if the thread is interrupted. The code restores the interrupt flag and rethrows as this KettleJobException so callers know the retry wait was cancelled.

Solutions

  1. Treat this as an intentional cancellation: stop the SFTP operation rather than retrying.
  2. Identify what interrupted the thread (job cancel/timeout) and adjust those settings if the interruption is unwanted.
  3. Avoid long delays between attempts so sleeps are short and cancellation windows small.
  4. Preserve the interrupt status in any wrapping code (the library already calls Thread.currentThread().interrupt()).

Example fix

// before
catch (KettleJobException e) { /* ignore and continue */ }
// after
catch (KettleJobException e) {
  if (Thread.currentThread().isInterrupted()) { log.info("cancelled"); return; }
  throw e;
}
Defensive patterns

Strategy: try-catch

Try / catch

try {
  client.login();
} catch (KettleJobException e) {
  if (Thread.currentThread().isInterrupted()) {
    log.info("Login retries cancelled by interrupt");
    return; // graceful cancellation
  }
  throw e;
}

Prevention

When it happens

Trigger: login() sleeping between connection retries when another thread calls interrupt() on the executing job thread (job cancel, shutdown, timeout watchdog).

Common situations: User cancels a stalled job in Spoon; job executor times out and interrupts the worker; application shutdown interrupting background retry loops.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/job/entries/sftp/SFTPClient.java:198

    int maxConnectionAttempts = 62;
    int delayBetweenEachAttempts = 100; // milliseconds

    while ( true ) {
      try {
        if ( tryCreateNewConnection( ) ) {
          break;
        }

        if ( --maxConnectionAttempts <= 0 ) {
          throw new KettleJobException( "Max connection attempts reached" );
        }
        Thread.sleep( delayBetweenEachAttempts );
        // incrementing delay by 100 milliseconds
        delayBetweenEachAttempts += 100;

      } catch ( InterruptedException ex ) {
        Thread.currentThread().interrupt();
        throw new KettleJobException( "Interrupted during a retry ", ex );
      } catch ( Exception e ) {
        throw new KettleJobException( "An unexpected error has occurred ", e );
      }
    }
  }

  private boolean tryCreateNewConnection(  ) {
    try {
      session.setPassword( this.getPassword() );
      java.util.Properties config = new java.util.Properties();
      config.put( "StrictHostKeyChecking", "no" );
      // set compression property
      // zlib, none
      String compress = getCompression();
      if ( compress != null ) {
        config.put( COMPRESSION_S2C, compress );
        config.put( COMPRESSION_C2S, compress );
      }

View on GitHub (pinned to f3058517a1)