Unable to execute HTTP request: Timeout waiting for connection from pool
0
I have microflow running as an Asynchronous, The issue occurs when we try to export business user reports that have more than 30 records (logs), due to the Merge Multiple Pdfs java action which is built to merge up to 100 pdfs we face below issue: Error Node ActionManager Message Exception in execution of monitored action '{"name":"ReturnedChecksLog.ACT_ReturnedChecksLog_Export_PDF_2","type":"Microflow"}' (execution id: 661a3f02-ae2b-43d8-b437-6b5570e7fcd6, execution type: CLIENT_ASYNC_MONITORED) Stack trace com.mendix.modules.microflowengine.MicroflowException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.amazonaws.SdkClientException: Unable to execute HTTP request: Timeout waiting for connection from pool at ReturnedChecksLog.ACT_ReturnedChecksLog_Export_PDF_2 (JavaAction : 'Merge multiple pdfs') Advanced stacktrace: at com.mendix.modules.microflowengine.MicroflowUtil.processException(MicroflowUtil.java:83) Caused by: com.mendix.core.CoreRuntimeException: com.mendix.systemwideinterfaces.MendixRuntimeException: com.amazonaws.SdkClientException: Unable to execute HTTP request: Timeout waiting for connection from pool at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.scala:108) Caused by: com.mendix.systemwideinterfaces.MendixRuntimeException: com.amazonaws.SdkClientException: Unable to execute HTTP request: Timeout waiting for connection from pool at com.mendix.util.classloading.Runner$.withContextClassLoader(Runner.scala:23) Caused by: com.amazonaws.SdkClientException: Unable to execute HTTP request: Timeout waiting for connection from pool at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleRetryableException(AmazonHttpClient.java:1219) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1165) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:814) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:781) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:755) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:715) at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:697) at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:561) at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:541) at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:5456) at com.amazonaws.services.s3.AmazonS3Client.getBucketRegionViaHeadRequest(AmazonS3Client.java:6432) at com.amazonaws.services.s3.AmazonS3Client.fetchRegionFromCache(AmazonS3Client.java:6404) at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:5441) at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:5403) at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1524) at com.mendix.storage.s3.internal.AmazonS3StorageService.$anonfun$doRetrieve$2(AmazonS3StorageService.scala:65) at com.mendix.storage.s3.internal.AmazonS3StorageService.handleNotExistingFiles(AmazonS3StorageService.scala:200) at com.mendix.storage.s3.internal.AmazonS3StorageService.$anonfun$doRetrieve$1(AmazonS3StorageService.scala:63) at com.mendix.storage.s3.internal.AmazonS3StorageService.wrapException(AmazonS3StorageService.scala:192) at com.mendix.storage.s3.internal.AmazonS3StorageService.doRetrieve(AmazonS3StorageService.scala:63) at com.mendix.storage.AbstractStorageService.retrieve(AbstractStorageService.scala:37) at com.mendix.filedocumentprocessor.internal.FileDocumentProcessorImpl.getFileDocument(FileDocumentProcessorImpl.scala:38) at com.mendix.basis.component.FileDocumentCore.getFileDocumentContent(FileDocumentCore.scala:15) at com.mendix.basis.component.FileDocumentCore.getFileDocumentContent$(FileDocumentCore.scala:11) at com.mendix.basis.component.InternalCore.getFileDocumentContent(InternalCore.scala:24) at com.mendix.core.Core.getFileDocumentContent(Core.java:1234) at communitycommons.Misc.mergePDF(Misc.java:630) at communitycommons.actions.MergeMultiplePdfs.executeAction(MergeMultiplePdfs.java:46) at communitycommons.actions.MergeMultiplePdfs.executeAction(MergeMultiplePdfs.java:20) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:58) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:71) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:48) at com.mendix.core.actionmanagement.internal.InternalCoreAction.call(InternalCoreAction.java:56) at com.mendix.basis.actionmanagement.ActionManager.$anonfun$executeSync$2(ActionManager.scala:104) at com.mendix.util.classloading.Runner$.withContextClassLoader(Runner.scala:20) at com.mendix.basis.actionmanagement.ActionManager.executeSync(ActionManager.scala:103) at com.mendix.basis.actionmanagement.UserActionCallBuilderImpl.execute(UserActionCallBuilderImpl.scala:57) at com.mendix.modules.microflowengine.actions.actioncall.ForegroundJavaAction.doExecute(ForegroundJavaAction.scala:35) at com.mendix.modules.microflowengine.actions.actioncall.ForegroundJavaAction.doExecute(ForegroundJavaAction.scala:11) at com.mendix.modules.microflowengine.actions.actioncall.JavaAction.execute(JavaAction.scala:38) at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.$anonfun$execute$1(MicroflowObject.scala:32) at scala.Option.flatMap(Option.scala:283) at com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.scala:29) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.$anonfun$executeAfterBreakingIfNecessary$2(MicroflowImpl.scala:167) at scala.Option.flatMap(Option.scala:283) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.scala:167) at com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.scala:114) at com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:58) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:71) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:48) at com.mendix.core.actionmanagement.internal.InternalCoreAction.call(InternalCoreAction.java:56) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.$anonfun$runMonitoredAction$1(CoreActionHandlerImpl.scala:59) at com.mendix.basis.actionmanagement.ActionMonitoring$.$anonfun$monitor$1(ActionMonitoring.scala:49) at com.mendix.util.classloading.Runner$.withContextClassLoader(Runner.scala:20) at com.mendix.basis.actionmanagement.ActionMonitoring$.monitor(ActionMonitoring.scala:49) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.runMonitoredAction(CoreActionHandlerImpl.scala:59) at com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:46) at com.mendix.core.actionmanagement.internal.InternalCoreAction.call(InternalCoreAction.java:56) at com.mendix.basis.actionmanagement.ActionManager.$anonfun$executeAsync$3(ActionManager.scala:87) at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:678) at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:467) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection from pool at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.leaseConnection(PoolingHttpClientConnectionManager.java:316) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager$1.get(PoolingHttpClientConnectionManager.java:282) at jdk.internal.reflect.GeneratedMethodAccessor26.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.amazonaws.http.conn.ClientConnectionRequestFactory$Handler.invoke(ClientConnectionRequestFactory.java:70) at com.amazonaws.http.conn.$Proxy25.get(Unknown Source) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:190) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56) at com.amazonaws.http.apache.client.impl.SdkHttpClient.execute(SdkHttpClient.java:72) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1346) at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1157) ... 62 more
asked
Muath Battah
1 answers
0
Muath,
I think you are running into a timeout due to the large number of files you are trying to merge at once. When I need to merge a large number of files, I have had success merging them in batches of 5 or 10. You can loop through the list (inside of a While loop) and merge the files in smaller groups. Let me know if this resolves the issue.