[ https://issues.apache.org/jira/browse/HADOOP-19609?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18014402#comment-18014402 ]
ASF GitHub Bot commented on HADOOP-19609: ----------------------------------------- bhattmanish98 commented on code in PR #7817: URL: https://github.com/apache/hadoop/pull/7817#discussion_r2280769103 ########## hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/ITestAbfsClient.java: ########## @@ -869,4 +874,217 @@ private void testIsNonEmptyDirectoryInternal(String firstCT, .listPath(eq("/testPath"), eq(false), eq(1), any(), any(TracingContext.class), any()); } + + /** + * Test to verify that the KeepAliveCache is initialized with the correct number of connections. + * This test is applicable only for ApacheHttpClient. + */ + @Test + public void testKeepAliveCacheInitializationWithApacheHttpClient() throws Exception { + Assume.assumeTrue(APACHE_HTTP_CLIENT == httpOperationType); + final AzureBlobFileSystem fs = this.getFileSystem(); + AbfsClientHandler abfsClientHandler = fs.getAbfsStore().getClientHandler(); + + AbfsClient dfsClient = abfsClientHandler.getDfsClient(); + AbfsClient blobClient = abfsClientHandler.getBlobClient(); + + checkKacOnBothClientsAfterFSInit(dfsClient); + checkKacOnBothClientsAfterFSInit(blobClient); + } + + /** + * Test to verify the behavior of stale connections in the KeepAliveCache. + * This test is applicable only for ApacheHttpClient. + */ + @Test + public void testStaleConnectionBehavior() throws Exception { + Assume.assumeTrue(APACHE_HTTP_CLIENT == httpOperationType); + Configuration conf = this.getFileSystem().getConf(); + + // This is to avoid actual metric calls during the test + conf.unset(FS_AZURE_METRIC_ACCOUNT_NAME); + + // Initialize the file system + AzureBlobFileSystemStore store = this.getFileSystem(conf).getAbfsStore(); + AbfsClientHandler abfsClientHandler = store.getClientHandler(); + + AbfsClient dfsClient = abfsClientHandler.getDfsClient(); + AbfsClient blobClient = abfsClientHandler.getBlobClient(); + + checkKacOnBothClientsAfterFSInit(dfsClient); + checkKacOnBothClientsAfterFSInit(blobClient); + + // Wait for 5 minutes to make the cached connections stale Review Comment: During POC we found out this timeout time. > 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: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org