[
https://issues.apache.org/jira/browse/HDFS-13330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16414493#comment-16414493
]
Chris Douglas commented on HDFS-13330:
--------------------------------------
bq. Instead of fixing this jira, I am more inclined to revert HDFS-8979 which
already broke 2 other functionalities.
To be fair to HDFS-8979, it didn't break the retry functionality. The retry
loop never worked. Static analysis tools are identifying dead code, and these
JIRAs are removing it instead of asking why it's dead. In this case, the code
assumed that in do/while loops, the loop expression is not evaluated after a
{{continue}}, which is [not the
case|https://docs.oracle.com/javase/specs/jls/se8/html/jls-14.html#jls-14.13.1].
Whether we fix the retry logic in this JIRA or we open a new one, I think we
can agree that simply removing the dead code isn't making meaningful progress.
> Clean up dead code
> ------------------
>
> Key: HDFS-13330
> URL: https://issues.apache.org/jira/browse/HDFS-13330
> Project: Hadoop HDFS
> Issue Type: Improvement
> Reporter: Wei-Chiu Chuang
> Assignee: Gabor Bota
> Priority: Minor
> Attachments: HDFS-13330.001.patch
>
>
> The follow do .. while(false) loop seems useless to me.
> {code:java:title=ShortCircuitCache#fetchOrCreate}
> ShortCircuitReplicaInfo info = null;
> do {
> if (closed) {
> LOG.trace("{}: can't fethchOrCreate {} because the cache is closed.",
> this, key);
> return null;
> }
> Waitable<ShortCircuitReplicaInfo> waitable = replicaInfoMap.get(key);
> if (waitable != null) {
> try {
> info = fetch(key, waitable);
> } catch (RetriableException e) {
> LOG.debug("{}: retrying {}", this, e.getMessage());
> }
> }
> } while (false);{code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]