ayushtkn commented on code in PR #5372:
URL: https://github.com/apache/hadoop/pull/5372#discussion_r1101038386
##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/TestSymlinkHdfs.java:
##########
@@ -100,7 +100,7 @@ public static void afterClassTeardown() throws Exception {
if (cluster != null) {
cluster.shutdown();
}
- IOUtils.closeQuietly(webhdfs);
+ IOUtils.closeStream(webhdfs);
Review Comment:
I am not sure what @steveloughran meant here:
https://github.com/apache/hadoop/pull/5342#issuecomment-1422976653
by
```
should have said use o.a.hadoop.utils.IOUtils.closeStream(), because that
one logs at debug if an exception is raised
```
``IOUtils.closeStream(webhdfs);`` won't be logging either.
Check the code:
It calls ``cleanUpWithLogger``, with Logger passed as ``null``
```
public static void closeStream(java.io.Closeable stream) {
if (stream != null) {
cleanupWithLogger(null, stream);
}
```
And ``cleanUpWithLogger`` won't log because we passed ``null`` for ``logger``
```
} catch (Throwable e) {
if (logger != null) {
logger.debug("Exception in closing {}", c, e);
}
```
May be the intention was to ask: use `` IOUtils.cleanupWithLogger(LOG,
webhdfs);``
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]