Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Set fs.automatic.close to false in Hadoop configuration #614

Merged
merged 1 commit into from
Apr 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/main/java/io/confluent/connect/hdfs/DataWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,17 @@ public DataWriter(
hadoopConfiguration.addResource(new Path(config.hadoopConfDir() + "/hdfs-site.xml"));
}

// By default all FileSystem clients created through the java Hadoop clients are auto
// closed at JVM shutdown. This can interfere with the normal shutdown logic of the connector
// where the created clients are used to clean up temporary files (if the client was closed
// prior, then this operation throws a Filesystem Closed error). To prevent this behavior we
// set the Hadoop configuration fs.automatic.close to false. All created clients are closed as
// part of the connector lifecycle. This is anyways necessary as during connector deletion the
// connector lifecycle needs to close the clients, as the JVM shutdown hooks don't come into the
// picture. Hence we should always operate with fs.automatic.close as false. If in future we
// find that we are leaking client connections, we need to fix the lifecycle to close those.
hadoopConfiguration.setBoolean("fs.automatic.close", false);

if (config.kerberosAuthentication()) {
configureKerberosAuthentication(hadoopConfiguration);
}
Expand Down