{"record":{"id":"bebb15e91b0d658f","repo":"pentaho/pentaho-kettle","slug":"vfs-provider-s3-transfer-interrupted","errorCode":"vfs.provider.s3/transfer.interrupted","errorMessage":"vfs.provider.s3/transfer.interrupted","messagePattern":"vfs\\.provider\\.s3/transfer\\.interrupted","errorType":"error_code","errorClass":"FileSystemException","httpStatus":null,"severity":"warning","filePath":"plugins/s3-vfs/core/src/main/java/org/pentaho/s3common/S3TransferManager.java","lineNumber":71,"sourceCode":"  public void copy( S3CommonFileObject src, S3CommonFileObject dst ) throws FileSystemException {\n    if ( src == null || dst == null\n      || src.bucketName == null || src.key == null\n      || dst.bucketName == null || dst.key == null ) {\n      throw new FileSystemException( \"vfs.provider.s3/transfer.null-argument\",\n        src != null ? src.getQualifiedName() : \"null\",\n        dst != null ? dst.getQualifiedName() : \"null\" );\n    }\n    try {\n      Copy copy = getTransferManager().copy(\n        src.bucketName, src.key,\n        dst.bucketName, dst.key\n      );\n      copy.waitForCompletion();\n      logger.info( \"S3->S3 server-side copy succeeded: {} -> {}\",\n                   src.getQualifiedName(), dst.getQualifiedName() );\n    } catch ( InterruptedException ie ) {\n      Thread.currentThread().interrupt();\n      throw new FileSystemException( \"vfs.provider.s3/transfer.interrupted\",\n                                     src.getQualifiedName(), dst.getQualifiedName(), ie );\n    } catch ( AmazonClientException e ) {\n      throw new FileSystemException( \"vfs.provider.s3/transfer.error\",\n                                     src.getQualifiedName(), dst.getQualifiedName(), e );\n    }\n  }\n\n  public void upload( FileObject src, S3CommonFileObject dst ) throws FileSystemException {\n    if ( src == null || dst == null\n      || dst.bucketName == null || dst.key == null ) {\n      throw new FileSystemException( \"vfs.provider.s3/transfer.null-argument\",\n        src != null ? src.getName().getURI() : \"null\",\n        dst != null ? dst.getQualifiedName() : \"null\" );\n    }\n    try ( InputStream in = src.getContent().getInputStream() ) {\n      String bucket = dst.bucketName;\n      String key = dst.key;\n      ObjectMetadata metadata = new ObjectMetadata();","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/s3-vfs/core/src/main/java/org/pentaho/s3common/S3TransferManager.java#L53-L89","documentation":"Thrown by S3TransferManager.copy() when the thread waiting on copy.waitForCompletion() is interrupted. The interrupt flag is re-set on the thread before throwing, and the S3->S3 server-side copy may or may not have completed on the service side.","triggerScenarios":"Calling copy() from a thread that is interrupted (shutdown, timeout, cancellation) while blocked in waitForCompletion().","commonSituations":"Executor shutdown during a long copy; task cancellation frameworks interrupting workers; application undeploy/restart mid-copy.","solutions":["Avoid interrupting worker threads mid-copy, or treat the copy as canceled and clean up the partial destination object","Check the S3 destination afterwards — the server-side copy may have completed despite the interrupt","Preserve the interrupt status (the library already calls Thread.currentThread().interrupt()) and propagate","Increase the shutdown grace period for executors running transfers"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  transferManager.copy( src, dst );\n} catch ( FileSystemException e ) {\n  if ( \"vfs.provider.s3/transfer.interrupted\".equals( e.getMessage() ) ) {\n    Thread.interrupted(); // or leave status set; decide whether to verify/copy destination\n  }\n  throw e;\n}","preventionTips":["Avoid interrupting threads performing waitForCompletion()","Use graceful shutdown that lets in-flight copies drain","After an interrupt, check the destination object to see if the copy completed","Provide explicit cancellation rather than thread interrupts for long transfers"],"tags":["s3","vfs","interrupt","copy"],"backgroundTag":"thread-interrupted","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}