Fix when hdfsBuilderConnect returns NULL, HadoopFileSystem::FileExists returns errors::NotFound exception
This commit is contained in:
parent
e203dad029
commit
c49c73559a
@ -217,7 +217,7 @@ hdfsFS Connect(tf_hadoop_filesystem::HadoopFile* hadoop_file,
|
||||
hadoop_file->connection_cache.end()) {
|
||||
auto cacheFs = libhdfs->hdfsBuilderConnect(builder);
|
||||
if (cacheFs == nullptr) {
|
||||
TF_SetStatusFromIOError(status, TF_NOT_FOUND, strerror(errno));
|
||||
TF_SetStatusFromIOError(status, TF_ABORTED, strerror(errno));
|
||||
return cacheFs;
|
||||
}
|
||||
hadoop_file->connection_cache[cacheKey] = cacheFs;
|
||||
|
@ -196,7 +196,7 @@ Status HadoopFileSystem::Connect(StringPiece fname, hdfsFS* fs) {
|
||||
if (connectionCache_.find(cacheKey) == connectionCache_.end()) {
|
||||
hdfsFS cacheFs = libhdfs()->hdfsBuilderConnect(builder);
|
||||
if (cacheFs == nullptr) {
|
||||
return errors::NotFound(strerror(errno));
|
||||
return errors::Aborted(strerror(errno));
|
||||
}
|
||||
connectionCache_[cacheKey] = cacheFs;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user