Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest version of Parse Server and the Parse Android SDK.
Issue Description
Parse Android SDK hangs when issuing getData()
call for large file on slow network.
Steps to reproduce
Store a large file in Parse and try to get its data synchronously (on background thread) using getData()
call when a mobile device is connected to slow network (or slowed down emulator).
Actual Outcome
getData()
call hangs indefinitely.
Expected Outcome
getData()
should either succeed, or throw an exception.
Environment
Parse Android SDK
- SDK version:
3.0.0
- Operating system version:
Android 11
Server
- Parse Server version:
5.1.1
- Operating system:
Ubuntu 20.04
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
Digital Ocean
Database
- System (MongoDB or Postgres):
MongoDB
- Database version:
3.6.8
Logs
Nginx last entry in access.log
when Andorid SDK hangs on slow network:
85.250.100.140 - - [23/Mar/2022:19:43:41 +0000] "GET /parse/classes/Book/Cq1hFjlytH HTTP/2.0" 200 267 "-" "Parse Android SDK API Level 30"
On faster network (LTE), I Nginx's access.log
shows the following:
85.250.100.140 - - [23/Mar/2022:19:45:34 +0000] "GET /parse/classes/Book/Cq1hFjlytH HTTP/2.0" 200 267 "-" "Parse Android SDK API Level 30" "-"
85.250.100.140 - - [23/Mar/2022:19:45:37 +0000] "GET /parse/files/appid/67dfb4b64a2682765d9b34f34e5bfe00_shvilim-14.pdf HTTP/2.0" 200 28613718 "-" "Parse Android SDK API Level 30" "-"
Additional info
First, I thought that the problem is client-side timeout. So, I increased it:
Parse.initialize(new Parse.Configuration.Builder(this)
.applicationId("<appid>")
.server("<url>")
.enableLocalDataStore()
.allowCustomObjectId()
.clientBuilder(
new OkHttpClient.Builder()
.readTimeout(60, TimeUnit.SECONDS)
.writeTimeout(60, TimeUnit.SECONDS)
)
.build()
Unfortunately, did not work.
Then I increased timeouts for Nginx:
http {
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_send_timeout 300;
send_timeout 300;
...
}
Did not work either.
This is a critical problem for us. If Parse Android SDK would just throw an exception instead of hanging it would make the situtation much better.