Github user mattyb149 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2755#discussion_r194413976
--- Diff:
nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/src/main/java/org/apache/nifi/processors/hive/PutHive3Streaming.java
---
@@ -397,6 +398,9 @@ public void onTrigger(ProcessContext context,
ProcessSession session) throws Pro
}
hiveStreamingConnection = makeStreamingConnection(options,
reader);
+ // Add shutdown handler with higher priority than
FileSystem shutdown hook so that streaming connection gets closed first before
+ // filesystem close (to avoid ClosedChannelException)
+
ShutdownHookManager.addShutdownHook(hiveStreamingConnection::close,
FileSystem.SHUTDOWN_HOOK_PRIORITY + 1);
--- End diff --
We have a full exception handling thing in the framework, but I will need
to abort and close on other uncaught exceptions, so I changed the
catch(Exception e) to catch(Throwable t)
---