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

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

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


##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/ITestApacheClientConnectionPool.java:
##########
@@ -118,6 +121,38 @@ public void testConnectedConnectionLogging() throws 
Exception {
         .isEqualTo(4);
   }
 
+  /**
+   * Test to verify that the ApacheHttpClient falls back to JDK client
+   * when connection warmup fails.
+   * This test is applicable only for ApacheHttpClient.
+   */
+  @Test
+  public void testApacheClientFallbackDuringConnectionWarmup()
+      throws Exception {
+    try (KeepAliveCache keepAliveCache = new KeepAliveCache(
+        new AbfsConfiguration(new Configuration(), EMPTY_STRING))) {
+      // Create a connection manager with invalid URL to force fallback to JDK 
client
+      // during connection warmup.
+      // This is to simulate failure during connection warmup in the 
connection manager.
+      // The invalid URL will cause the connection manager to fail to create 
connections
+      // during warmup, forcing it to fall back to JDK client.
+      final AbfsConnectionManager connMgr = new AbfsConnectionManager(
+          RegistryBuilder.<ConnectionSocketFactory>create()
+              .register(HTTPS_SCHEME, new SSLConnectionSocketFactory(
+                  DelegatingSSLSocketFactory.getDefaultFactory(),
+                  getDefaultHostnameVerifier()))
+              .build(),
+          new AbfsHttpClientConnectionFactory(), keepAliveCache,
+          new AbfsConfiguration(new Configuration(), EMPTY_STRING),
+          new URL("https://test.com";), true);
+
+      Assertions.assertThat(AbfsApacheHttpClient.usable())
+          .describedAs("Apache HttpClient should be not usable")

Review Comment:
   Sure, will do that.





> 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