Issue
The application logs show the following timeout error when attempting to merge more than 10 Portable Document Format (PDF) into a single document at once using the Community Commons MergeMultiplePdfs Java action. This timeout exception does not occur while running the application locally.
ERROR - DocGen: Bordereau generation failed at merging documents due to the following:
2025-02-03T00:04:20.897207 [APP/PROC/WEB/0] Type: org.apache.http.conn.ConnectionPoolTimeoutException
2025-02-03T00:04:20.897216 [APP/PROC/WEB/0] Reason: Timeout waiting for connection from pool
2025-02-03T00:04:20.897261 [APP/PROC/WEB/0] Stack: com.mendix.systemwideinterfaces.MendixRuntimeException: com.amazonaws.SdkClientException: Unable to execute HTTP request: Timeout waiting for connection from pool
Environment
Applications hosted in Mendix Cloud
Community Commons (all versions)
Cause
As outlined in our documentation, the Community Commons module has a default restriction, allowing only 10 files to be processed at once for compatibility with Mendix Cloud. If the number of PDF files being merged exceeds the default restriction of 10, a timeout can occur. This happens because each opened file requires a connection to an Amazon Simple Storage Service (S3) bucket. When many files are processed simultaneously, the available connection pool becomes exhausted, preventing new connections from being established and ultimately resulting in a timeout error.
Solution/Workaround
To avoid a timeout error, there are two options:
- It is recommended to handle the merge of the PDFs in batches of 10.
- If more than 10 files need to be merged, the default merge limit can be changed. Keep in mind that merging PDFs in batches is still the recommended approach. Additionally, since the application's behavior may vary, it is important to monitor its performance to ensure optimal behavior. To override the value, follow these steps:
-
-
- In Studio Pro, open the App Explorer and find the Community Commons module under Marketplace Modules.
- Navigate to the Constants folder and select MergeMultiplePdfs_MaxAtOnce.
- Change the default value as needed. Setting the value to <= 0 means unlimited.
- Click Ok and close the window
-
Internal information related
- Zendesk tickets: #240303
- Slack thread: #runtime-totw
Additional information
Mendix documentation: Community Commons
0 Comments