-
Notifications
You must be signed in to change notification settings - Fork 158
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
Parallel requests cause responses to get mixed #57
Comments
Another misbehavior is that when GETing the same url with the same |
This seems like it is responsible for the various issues I'm having with response compression when trying this preview:
And others:
|
There's a concurrency issue when using the EnableQueryAttribute since 7.5.4. |
Got the same issue, when a lot of request arrive at the same time, there is a chance that some of them end up in a {
"ClassName": "System.ObjectDisposedException",
"Message": "Cannot write to the response body, the response has completed.",
"Data": null,
"InnerException": null,
"HelpURL": null,
"StackTraceString": "
at Microsoft.AspNetCore.Server.IIS.Core.HttpResponseStream.ValidateState(CancellationToken cancellationToken)
at Microsoft.AspNetCore.Server.IIS.Core.HttpResponseStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
at Microsoft.AspNetCore.Server.IIS.Core.WrappingStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
at Microsoft.AspNetCore.OData.Formatter.StreamWrapper.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
at Microsoft.OData.MessageStreamWrapper.MessageStreamWrappingStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
at Microsoft.OData.AsyncBufferedStream.FlushBuffersAsync(Queue`1 buffers)+MoveNext()
at Microsoft.OData.TaskUtils.<>c__DisplayClass25_0.<Iterate>b__1(Task antecedent)
",
"RemoteStackTraceString": null,
"RemoteStackIndex": 0,
"ExceptionMethod": null,
"HResult": -2146232798,
"Source": "Microsoft.AspNetCore.Server.IIS",
"WatsonBuckets": null,
"ObjectName": "HttpResponseStream"
} |
I'm facing the same issue in version 8.0.10 |
8.0.2 |
@xuzhg this looks like the most critical issue currently tracked in the repo... is anyone actively looking into it? Could it be bumped in priority? |
It's critical. Please have a look with high priority. |
We got same issue. Waiting for fix. Thank you. |
@xuzhg Is there any chance that you can look after this issue? I can reproduce it very easily on my machine with version 8.0.12. Everything will run without any exception. When Adding Maybe my tests can help a little bit. |
When 2 requests are performed at the same time, there is a possibility that one's response will contain 2 concatenated JSON strings
and the other will crash with
System.ObjectDisposedException: Cannot write to the response body, the response has completed. Object name: 'HttpResponseStream'
orSystem.InvalidOperationException: Reading is already in progress.
.I've created a minimal repo you can clone and try to reproduce the issue. It uses efcore with in memory database but the same happens with SQL Server. I've also added a readme for the few steps required to reproduce the issue.
Tried the same with an Api Controller and had no issues.
NET 5
,Microsoft.AspNetCore.OData 8.0.0-preview3
,Visual Studio 2019 16.8.3
The text was updated successfully, but these errors were encountered: