-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Queries with Parse.Promise.when cause "Request timeout" #456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I just changed all those calls so they do queries in series, which made them significantly slower, but at least they started working again. Would still like to know if Here's the call that works:
|
I think I'm seeing the same thing. We have cloud code that is structured similar to the first example: create an array of promises and then wait for them all to complete before returning to the client. I'm finding that while this cloud code ran fine on hosted parse, it times out in the open source version. Are promises a work in progress? |
Promises are not a work in progress, this sounds like a real bug. We'll see if we can track this down. If you would like to help, you could submit a PR that includes a failing test case, or check the source to see if you can narrow down where the issue might be. |
Does this bug exist in all version of Pars-server ? Or just in 2.0.1 up? |
I added a function that demonstrates issue parse-community#456. I'm finding that if I don't specify a rejected callback for the Parse.Config.get() promise's Then method, it never reaches my When method and the function times out. I found this worked in hosted parse but not in the open source version. parse-community#456
@refre5h @derekvanvliet Please see the PR that I just opened, in spec/issue456.spec.js that tries to reproduce the bug. |
This could be timing out if they are querying large amounts of data, as we no longer enforce query size limits like we did in Parse Server. @refre5h @derekvanvliet do you still have the problem if you add a limit to your query? |
@flovilmart @drew-gross The timeout happens when the
However, it does not time out if it's structured like this:
I have just tested these in our server (Heroku + MongoLab, both free tier) against 2 tables that each have less than 20 entries, the one with the |
@refre5h See the latest version of the test I'm running, and in particular: "testCreateManyObjectInParallel" Then I fetch all of those objects, (the 400) with 2 queries built the way you describe. And it's still working correctly. |
@drew-gross all of my queries (except for config.get) use limits and I was still having the problem. The problem went away for me when I added the rejected callbacks to the promise (as described in PR #479) |
So the timeout was likely to be because you were not handling errors? |
@refre5h I think we have traced @derekvanvliet to a missing environment variable (the one that enables experimental config in Parse Server). Also, do any the promises in the array you pass to |
@drew-gross No error, just times out. I don't think the promises in the array have failed. But I found some interesting stuffs. Read on. @flovilmart You are right, I ran the exact testCreateManyObjectInParallel call in our environment and it worked correctly without error or timeout. So I compared it with our original functions and discovered this one difference: In your code, the I then proceed to only put one I also tried removing the promise array and pass all queries individually to
|
It looks like @andrewimm changed the behaviour of |
@refre5h this is in the documentation of Parse.Promise in order to keep the consistency in the results depending how you passed you multiple promisses, as array or list of arguments. http://www.parse.com/docs/js/api/classes/Parse.Promise.html#methods_when :) |
Ahh... our hosted parse is using v1.6.14, which I think is why it's working there but not in parse-server. I think my issue is fixed. Thanks guys! |
There are a couple places in our app where we do things in parallel with
Parse.Promise.when()
, they worked in the Hosted Parse, but not anymore after migration. Is it supported?Here's the general structure of those cloud functions:
Server log when these functions are called:
at=error code=H12 desc="Request timeout" method=POST path="/parse/functions/myfunction" host=host request_id=123456 fwd="1.2.3.4" dyno=web.1 connect=1ms service=30001ms status=503 bytes=0
The text was updated successfully, but these errors were encountered: