-
Notifications
You must be signed in to change notification settings - Fork 47
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
Async server #159
Merged
Daniel-Svensson
merged 25 commits into
OpenRIAServices:master
from
Daniel-Svensson:feature/async_server
Aug 30, 2019
Merged
Async server #159
Daniel-Svensson
merged 25 commits into
OpenRIAServices:master
from
Daniel-Svensson:feature/async_server
Aug 30, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Daniel-Svensson
force-pushed
the
feature/async_server
branch
from
July 7, 2019 19:57
88eb58f
to
ee3129c
Compare
Daniel-Svensson
force-pushed
the
feature/async_server
branch
from
July 12, 2019 19:45
ee3129c
to
7a5be29
Compare
Daniel-Svensson
force-pushed
the
feature/async_server
branch
from
July 25, 2019 14:31
2d80d0c
to
08f5db0
Compare
Daniel-Svensson
force-pushed
the
feature/async_server
branch
from
August 23, 2019 14:59
c4d538f
to
4e385da
Compare
Daniel-Svensson
commented
Aug 23, 2019
src/Test/Desktop/OpenRiaServices.Common.Test/ExceptionHelper.cs
Outdated
Show resolved
Hide resolved
Daniel-Svensson
force-pushed
the
feature/async_server
branch
from
August 23, 2019 15:42
4e385da
to
f3ec771
Compare
Daniel-Svensson
commented
Aug 23, 2019
...nServices.Hosting.OData/Framework/DomainServices/DomainDataServiceInvokeOperationBehavior.cs
Outdated
Show resolved
Hide resolved
src/OpenRiaServices.DomainServices.EntityFramework/Framework/LinqToEntitiesDomainService.cs
Outdated
Show resolved
Hide resolved
...penRiaServices.DomainServices.Hosting/Framework/Services/Behaviors/DomainOperationInvoker.cs
Outdated
Show resolved
Hide resolved
src/OpenRiaServices.DomainServices.Hosting/Framework/Services/DomainServiceHost.cs
Show resolved
Hide resolved
|
||
validationResults = (validationErrors == null) ? null : validationErrors.ToList(); | ||
// TODO: Remove blocking wait |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add separate issue for this
Daniel-Svensson
commented
Aug 24, 2019
Daniel-Svensson
commented
Aug 24, 2019
/// <returns>The query results. May be null if there are no query results.</returns> | ||
public virtual IEnumerable Query(QueryDescription queryDescription, out IEnumerable<ValidationResult> validationErrors, out int totalCount) | ||
public async virtual ValueTask<ServiceQueryResult> QueryAsync<T>(QueryDescription queryDescription, CancellationToken cancellationToken) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See if it makes sense to make ServiceQueryResult generic. (Can be made later)
Daniel-Svensson
commented
Aug 24, 2019
src/OpenRiaServices.DomainServices.Server/Framework/Data/DomainService.cs
Outdated
Show resolved
Hide resolved
Daniel-Svensson
commented
Aug 24, 2019
src/OpenRiaServices.DomainServices.Server/Framework/Data/DomainService.cs
Outdated
Show resolved
Hide resolved
Daniel-Svensson
force-pushed
the
feature/async_server
branch
from
August 25, 2019 18:33
6a98060
to
441d5a8
Compare
11 tasks
…sync methods when it cannot
… not throw when checking if stacktraces should be sent
* Fix DbDomainService implementation to be async aware * this removes some reflection calls * Fic more test so that they are async
Daniel-Svensson
force-pushed
the
feature/async_server
branch
from
August 30, 2019 10:58
90fda5b
to
37b7efb
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The goal is to make the Server part truly async in order to have it scale better while using fewer threads and to prepare it for working well when running on aspnetcore (in any form).
Make query async
Make Invoke async
Make submit async
Support returning ValueTask<..> (for invoke & queries)?
Is it a good idea even (due to reflection boxing it seems like there are no gains)
Need to add corresponding tests for ValueTask<..> methods before officially supporting them
Go through tests and ensure they await the result on query/invoke etc
Consider adding new Exception
DomainServiceValidationException
which takes IEnumerable`Add
CancellationToken
to async methods (usable by asp.net core …)questions to look into
Other changes
Performance under load of simple DomainService ìn Benhmarks repo which has a query with
Task:Delay(10 ms)
and then returns a singleCity
entity has increased significantly under load (tested on laptop with cooldown time between). Notice that it is burst performance which ismeasured and not steady state (it takes a while before the sync version has created enought threads to process the load).Left is master , right is this PR
Running on a workstation with low turbo boost and 10ms delay for each request gives the following numbers (but examples run at 0-2% CPU and is limited by the load testing applications):
Left is async (PR), left is master
Notice how max latency is much better for the async code