-
Notifications
You must be signed in to change notification settings - Fork 516
Treat ECONNRESET as a connection error (#934). #953
Conversation
4b960e1 to
c42ab12
Compare
|
Rebased. |
| .UseUrls($"http://127.0.0.1:0") | ||
| .Configure(app => app.Run(context => | ||
| { | ||
| return Task.FromResult(0); |
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.
We should also assert that context.Request.Body.ReadAsync fails with an IOException.
I think that SocketInputExtensions.ReadAsync and possibly a few other places will have to be updated to check if there is an error (possibly by calling SocketInput.GetResult()) in a thread-safe way before exiting due to RemoteIntakeFin being set.
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.
I've opened #959 to address this.
| var filteredWrites = testSink.Writes.Where(write => write.EventId.Id == connectionErrorEventId); | ||
| for (var i = 0; i < 10; i++) | ||
| { | ||
| System.Console.WriteLine(i); |
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.
Remove call to Console.WriteLine()?
c42ab12 to
7b4a6ab
Compare
|
|
||
| // Give it some time for the connection error log message to be logged | ||
| var filteredWrites = testSink.Writes.Where(write => write.EventId.Id == connectionErrorEventId); | ||
| for (var i = 0; i < 10; i++) |
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.
I would make the test code itself wait forever (rather than only 500ms), then wrap the whole test in a call to Task.Run().TimeoutAfter() with a large timeout (say 10 seconds), so it fails if it exceeds the timeout for any reason.
7b4a6ab to
122ea86
Compare
|
@halter73 Now handling error when checking for FIN. |
| } | ||
| } | ||
|
|
||
| private void ThrowOnConnectionError() |
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.
😞
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.
@davidfowl You're now well-versed in this code. Do you have a better alternative?
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.
Can we just use a Task instead?
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.
I also like this idea @CesarBS.
ccd701a to
ff13219
Compare
|
Updated to use |
| private bool _consuming; | ||
| private bool _disposed; | ||
|
|
||
| private TaskCompletionSource<bool> _tcs = new TaskCompletionSource<bool>(); |
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.
TaskCompletionSource<bool> implies Result is useful and might be false. Since it never will be, TaskCompletionSource<object> is probably better.
|
|
|
Updated tests:
|
|
Had to change
This is quite ugly. We should probably address this and have a single behavior, but I'd like it to be addressed as a separate task. |
27334f5 to
3bb7f4e
Compare
#934, #959
cc @halter73 @mikeharder