Sometimes I experience weird issue when loading Tasks over REST API using simple
SELECT Id, ... FROM Task SOQL query take quite some time and then returns with nothing, but on the second try it returns page of Tasks.
I am using restforce gem to access REST API. I tried it using both default Net::HTTP and Typhoeus adapters, with the similar result.
Any ideas why that happens and how to overcome this?
UPDATE 10 Oct 2013 Looks like this happens exactly 2 minutes after starting an API request independent of timeout settings I set on HTTP client. Looks like Salesforce has a maximum of 2 minutes for any SOQL query. If it takes more than 2 minutes to get the result, it will just kill the request. I haven't found any direct explanation/documentation on that, but I've seen mentions of 2 minutes maximum in similar contexts:
- http://community.cazoomi.com/cazoomi/topics/error_code_query_timeout -- apparently one can ask SF reps to lift up this timeout setting