Skip to content
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

Conversation

ElizabethOkerio
Copy link
Contributor

@ElizabethOkerio ElizabethOkerio commented May 29, 2020

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 default HttpWebRequest 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 by Microsoft.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)

  • Test cases added
  • Build and test with one-click build and test script passed

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.

@ElizabethOkerio ElizabethOkerio force-pushed the fix/update_read_and_write_timeout_properties_when_request_timeout_is_set branch from 289646a to ba04778 Compare May 29, 2020 09:10
@xuzhg xuzhg added this to the 7.7.0 milestone Jun 1, 2020
@xuzhg xuzhg added the Ready for review Use this label if a pull request is ready to be reviewed label Jun 1, 2020
Copy link
Member

@g2mula g2mula left a 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?

@ElizabethOkerio ElizabethOkerio force-pushed the fix/update_read_and_write_timeout_properties_when_request_timeout_is_set branch from 415e30b to 5bd4892 Compare June 8, 2020 07:19
}
set
{
this.client.Timeout = new TimeSpan(0, 0, value);
Copy link
Member

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.

@@ -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;
Copy link
Member

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" ?

Copy link
Contributor Author

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
Copy link
Contributor

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.

@ElizabethOkerio ElizabethOkerio force-pushed the fix/update_read_and_write_timeout_properties_when_request_timeout_is_set branch from c7df31e to d4fc201 Compare June 12, 2020 05:39
@ElizabethOkerio ElizabethOkerio force-pushed the fix/update_read_and_write_timeout_properties_when_request_timeout_is_set branch from d4fc201 to f7bd66b Compare June 12, 2020 06:00
@ElizabethOkerio ElizabethOkerio merged commit d6cebf5 into OData:master Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for review Use this label if a pull request is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants