-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Enable direct access by default #6636
Enable direct access by default #6636
Conversation
Its been a while since I looked into this. If I remember correctly the reason why the tests are failing is because of this the installationId is You should be able to fix the tests by setting an installationId not set to |
Thanks for the hint! I'll look into this. |
@dplewis @mtrezza It appears to me that the only place My guess / hope is that instead of firing an HTTP request for a query made in Cloud Code, it uses the mongo connection to make the request 'directly.' Is that what this option does? For example, I am hoping that if one had a Cloud Function with 3 queries contained in a Is that a correct understanding? |
@MobileVet Your understanding is correct. I abandoned the PR because I was removing the option to use direct access entirely, but I am not sure anymore direct access should be the only option. It may be detrimental to load distribution within an target group of server instances. So maybe enable it by default but leave it as an option to disable it. |
Wow... this changes everything, lol! I have been using Parse for a long time, but have only recently been delving into optimizations and performance issues. While I understood the REST API was used conceptually, the implications of such knowledge weren't apparent until I was reviewing our Sentry logs the other day.
At first blush, I can't imagine how this could be slower in our use case. We try to group our queries where ever possible and it is annoying to think they are taking up numerous instances to resolve. Granted, that allows the calling instance to maybe handle some other request while it is asynchronously waiting... but that still feels like more overhead. I suppose if one of those queries is long it could stall the instance and thereby starve other callers... but... hmm. Lots to consider. @mtrezza Is the only known issue the failing tests due to a session token problem? |
@mtrezza Can you fix the conflict and update from master? A few improvements have been made for directAccess. I want to see how many test fail now. |
I can't give an answer for which purposes the feature is currently fit. I can say however that the feature seems to be used by some developers in production already. |
@dplewis Unchanged I’d say. IIRC the issue was the test set-up itself that needs to be adapted for direct access. |
We are definitely going to give this a shot so I hope that the feature isn't removed entirely. It will be really interesting to see the results in our system. We currently handle ~75k sessions a day which isn't huge, but also nothing to sneeze at. Thanks for all of your work with it. |
Codecov Report
@@ Coverage Diff @@
## master #6636 +/- ##
==========================================
+ Coverage 93.57% 93.92% +0.34%
==========================================
Files 181 181
Lines 13193 13194 +1
==========================================
+ Hits 12345 12392 +47
+ Misses 848 802 -46
Continue to review full report at Codecov.
|
@mtrezza How does this look to you? I also fix a bug.
|
@mtrezza If you are interested in seeing my original solution https://gist.github.com/dplewis/3e911af29a667a88b9f92fa007e735e2 |
What do you think about keeping the option but default it to |
I like that idea. If you did that originally all the tests would have passed by setting directAccess: false lol |
My intention was to run all test with direct access |
@dplewis How do you feel about trying out a phased deprecation for this one? That would mean:
I would add the implications I described above to the Parse Server options doc for the |
Go for it. Hopefully this will bring awareness to this feature and we can get more feedback. |
That is perfect! |
Note, I'm working on adding the deprecation warning here, so this is still in DRAFT. |
Once #7303 is merged, the following deprecation definition needs to be added in
This will log a deprecation warning on Parse Server launch:
Then this should be ready for merge. |
After adding the deprecation definition, Parse Server logs the following warning if
This is the first attempt to apply the deprecation policy by using the deprecation mechanism to notify developers that This PR also adds a "Deprecation" section to the README to list the in-progress deprecations. |
@davimacedo could you take a look at this failing test? It fails at line: parse-server/spec/ParseServer.spec.js Line 110 in 9563793
with the expected deprecation warning that this PR outputs:
Your commit from back then says:
I think it was part of fixing #5573 (comment). Do you think we can change the test line above to be more specific?
I just want to make sure I'm not messing up the test here. |
@mtrezza there is a long time it was merged and it is hard to remember but I agree with your change. It looks good to me. |
If no further objections, I will merge this later today, since this has already gone through multiple reviews and is stopping other PRs from getting merged. There have only been some minor changes since the last review, so it should be good to go. |
* enabled direct access by default * removed obsolete direct access option test case * quick fix test * Set RESTController during tests * Properly handle RESTController * Documentation * revert changes * rerun tests * remove extra parse instance * Revert "remove extra parse instance" This reverts commit 21422f4. * Ensure restcontroller is set * Fix test * improved option docs * renamed direct access env var * added deprecations to README * added deprecation definition * fixed docs typo * improve promise rejection warning test * added renaming of env var to deprecation warning Co-authored-by: Diamond Lewis <[email protected]>
🎉 This change has been released in version 5.0.0-beta.1 |
🎉 This change has been released in version 5.0.0 |
New Pull Request Checklist
Issue Description
Picking up the experimental feature for direct access to Parse Server within Cloud Code.
Direct access has been merged as feature flagged here:
#2316
Related issue: #6637
TODOs before merging