Affects Version/s: 7.0.X, Master
Component/s: Portal Services > Store
When all connections are leaked, S3Store stops working as connection pool keeps all threads waiting. As a result, Document Library stops working.
Steps to Reproduce (via Groovy script)
- Setup Liferay DXP with S3Store configured
- Navigate to Documents and Media
- Create a Basic Document
- Navigate to Server Administration -> Script -> Groovy
- Copy/Paste the attached groovy script: test_s3_file_stream.groovy
- Execute Script (At least 3 times)
- By default, the maximum HTTP connections is set to 50.
- Each time the script runs, it will make 20 requests for retrieving the document as a stream.
- Running the script 3 times would make 60 requests total.
There will be no errors and the HTTP connections will not be exhausted
A ConnectionPoolTimeoutException is thrown:
From the source code, we can observe that when we request file to be returned as a stream, it provides the actual InputStream from the S3Object.
This means that if the requested stream is not closed, it could cause a potential connection leak.