-
Notifications
You must be signed in to change notification settings - Fork 352
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
update read write timeout value when timeout value is set #1796
update read write timeout value when timeout value is set #1796
Conversation
289646a
to
ba04778
Compare
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.
It seems to me that the new property is just a new way to surface the already existing Timeout property... What does it actually do?
src/Microsoft.OData.Client/Serialization/HttpWebRequestMessage.cs
Outdated
Show resolved
Hide resolved
415e30b
to
5bd4892
Compare
} | ||
set | ||
{ | ||
this.client.Timeout = new TimeSpan(0, 0, value); |
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.
Needs an summary documentation explaining the timeout is in seconds.
...alTests/Tests/DataServices/UnitTests/ClientExtensions/TestDataServiceClientRequestMessage.cs
Show resolved
Hide resolved
@@ -115,6 +115,9 @@ public class DataServiceContext | |||
#if !PORTABLELIB // Timeout not available | |||
/// <summary>time-out value in seconds, 0 for default</summary> | |||
private int timeout; |
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.
what's the difference between "timeout" and "readWriteTimeout" ?
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.
timeout is the number of milliseconds to wait before the request(basically the connection) timesout while readWriteTimeout is the number of milliseconds to wait before the writing/reading of a request/response timeouts.
/// The value may be changed between requests to a data service and the new value | ||
/// will be picked up by the next data service request. | ||
/// </remarks> | ||
public virtual int ReadWriteTimeout |
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.
Why wouldn't this be a TimeSpan? This creates no confusion, removes the need to mention seconds or convert it.
c7df31e
to
d4fc201
Compare
d4fc201
to
f7bd66b
Compare
Issues
This pull request fixes issue #1753.
Description
Currently, It is not possible to set the ReadWriteTimeout property of a request in
Microsoft.OData.Client
but you can set the Timeout property. This means that each request uses the defaultHttpWebRequest ReadWriteTimeout
property which is 300seconds or 5 minutes.If an endpoint takes more than 5 minutes to return a response to
Microsoft.OData.Client
that response will not be received and processed byMicrosoft.OData.Client
. This is because the ReadWriteTimeout property times out after 5 mins hence the ReadWrite connection times out.Checklist (Uncheck if it is not completed)
Additional work necessary
If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.