[
https://issues.apache.org/jira/browse/HADOOP-19609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18012573#comment-18012573
]
ASF GitHub Bot commented on HADOOP-19609:
-----------------------------------------
anmolanmol1234 commented on code in PR #7817:
URL: https://github.com/apache/hadoop/pull/7817#discussion_r2260193538
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/KeepAliveCache.java:
##########
@@ -212,45 +115,34 @@ public synchronized void close() {
@VisibleForTesting
void closeInternal() {
- timerTask.cancel();
- timer.purge();
- while (!empty()) {
- KeepAliveEntry e = pop();
- closeHttpClientConnection(e.httpClientConnection);
+ while (size() != 0) {
+ closeHttpClientConnection(removeFirst());
Review Comment:
Another thread may remove the last element right after your size() check,
causing removeFirst() to throw NoSuchElementException. So better to use
pollFirst() here
> ABFS: Apache Client Connection Pool Relook
> ------------------------------------------
>
> Key: HADOOP-19609
> URL: https://issues.apache.org/jira/browse/HADOOP-19609
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs/azure
> Affects Versions: 3.4.1
> Reporter: Manish Bhatt
> Assignee: Manish Bhatt
> Priority: Major
> Labels: pull-request-available
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]