[ 
https://issues.apache.org/jira/browse/HADOOP-19672?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18023086#comment-18023086
 ] 

ASF GitHub Bot commented on HADOOP-19672:
-----------------------------------------

anmolanmol1234 commented on code in PR #7967:
URL: https://github.com/apache/hadoop/pull/7967#discussion_r2381793492


##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsConnectionManager.java:
##########
@@ -91,26 +92,34 @@ class AbfsConnectionManager implements 
HttpClientConnectionManager {
   /**
    * The base host for which connections are managed.
    */
-  private HttpHost baseHost;
+  private final HttpHost baseHost;
 
   AbfsConnectionManager(Registry<ConnectionSocketFactory> 
socketFactoryRegistry,
-      AbfsHttpClientConnectionFactory connectionFactory, KeepAliveCache kac,
-      final AbfsConfiguration abfsConfiguration, final URL baseUrl) {
+      AbfsHttpClientConnectionFactory connectionFactory,
+      KeepAliveCache kac,
+      final AbfsConfiguration abfsConfiguration,
+      final URL baseUrl,
+      final boolean isCacheWarmupNeeded) {
     this.httpConnectionFactory = connectionFactory;
     this.kac = kac;
     this.connectionOperator = new DefaultHttpClientConnectionOperator(
         socketFactoryRegistry, null, null);
     this.abfsConfiguration = abfsConfiguration;
-    if (abfsConfiguration.getApacheCacheWarmupCount() > 0
+    this.baseHost = new HttpHost(baseUrl.getHost(),
+        baseUrl.getDefaultPort(), baseUrl.getProtocol());
+    if (isCacheWarmupNeeded && abfsConfiguration.getApacheCacheWarmupCount() > 0
         && kac.getFixedThreadPool() != null) {
       // Warm up the cache with connections.
       LOG.debug("Warming up the KeepAliveCache with {} connections",
           abfsConfiguration.getApacheCacheWarmupCount());
-      this.baseHost = new HttpHost(baseUrl.getHost(),
-          baseUrl.getDefaultPort(), baseUrl.getProtocol());
       HttpRoute route = new HttpRoute(baseHost, null, true);
-      cacheExtraConnection(route,
+      int totalConnectionsCreated = cacheExtraConnection(route,
           abfsConfiguration.getApacheCacheWarmupCount());
+      if (totalConnectionsCreated == 0) {

Review Comment:
   even if we fail or catch rejected exception for any one of the tasks we want 
to register fallback ? as the successfully submitted tasks might have increased 
the count of totalConnectionsCreated
   





> ABFS: Network Error-Based Client Switchover: Apache to JDK (continuous 
> failure))
> --------------------------------------------------------------------------------
>
>                 Key: HADOOP-19672
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19672
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs/azure
>    Affects Versions: 3.4.2
>            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]

Reply via email to