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

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

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


##########
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:
   Yes, make sense. I have updated the returned value in case of rejected 
exception; other thing will remain the same.



##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClientHandler.java:
##########
@@ -68,13 +68,13 @@ public AbfsClientHandler(final URL baseUrl,
       final SASTokenProvider sasTokenProvider,
       final EncryptionContextProvider encryptionContextProvider,
       final AbfsClientContext abfsClientContext) throws IOException {
+    initServiceType(abfsConfiguration);

Review Comment:
   This will initialize the default and ingress service types. This is needed 
before crating the clients so that we can do cache warmup only for default 
client.





> 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