[
https://issues.apache.org/jira/browse/HDFS-7764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14322442#comment-14322442
]
Rakesh R commented on HDFS-7764:
--------------------------------
Thanks [~cmccabe] for the interest.
bq.Can you explain why we would want to cancel the other pending tasks?
I was reviewing the code and saw {{public ScanInfoPerBlockPool call() throws
Exception}} can throw exception. My thought was, while iterating if any of the
{{compilersInProgress}} throws exception then will propogate this exception and
skip the current cycle. So as a good coding practise it would be good to cancel
all the given future tasks before exiting. Does this make sense to you?
bq. Did you see this code throw an exception in production?
Truly not.
> DirectoryScanner should cancel the future tasks when #compileReport throws
> exception
> ------------------------------------------------------------------------------------
>
> Key: HDFS-7764
> URL: https://issues.apache.org/jira/browse/HDFS-7764
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: datanode
> Affects Versions: 2.7.0
> Reporter: Rakesh R
> Assignee: Rakesh R
> Attachments: HDFS-7764.patch
>
>
> If there is an exception while preparing the ScanInfo for the blocks in the
> directory, DirectoryScanner is immediately throwing exception and coming out
> of the current scan cycle. It would be good if he can signal #cancel() to the
> other pending tasks .
> DirectoryScanner.java
> {code}
> for (Entry<Integer, Future<ScanInfoPerBlockPool>> report :
> compilersInProgress.entrySet()) {
> try {
> dirReports[report.getKey()] = report.getValue().get();
> } catch (Exception ex) {
> LOG.error("Error compiling report", ex);
> // Propagate ex to DataBlockScanner to deal with
> throw new RuntimeException(ex);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)