Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Increase AndroidClientHandler timeouts#3328

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

grendello
Copy link
Contributor

AndroidClientHandler has no way of accessing theHttpClient.Timeout property
in order to set the timeout value oftwo native http client
properties (connect and read timeouts) and so it uses two custom properties to
provide these values. So far, the values were set to 100s for the read timeout
and 120s for the connect timeout, which seemed to be a reasonable value for
their purposes. However, if a developer setsHttpClient.Timeout to a
valuelarger than our defaults,AndroidClientHandler values "win" and the
connection/read time out earlier. The workaround is to set "our" timeouts along
with theHttpClient one, but if the developer cannot do it, for any kind of
reasons (i.e. to avoid platform-specific code) then they are faced with an
annoying situation.

The real fix would be to improveHttpClient API so that its associated client
handler can accessHttpClient properties, but since it's not a quick fix we
can implement now, this commit bumps the default timeout values to
the (unreasonable) value of 24h to make sure we use values higher than the most
likely figures assigned toHttpClient.Timeout and to match Xamarin.iOS
NSUrlSessionHandler defaults.

`AndroidClientHandler` has no way of accessing the `HttpClient.Timeout` propertyin order to set the timeout value of *two* native http clientproperties (connect and read timeouts) and so it uses two custom properties toprovide these values. So far, the values were set to 100s for the read timeoutand 120s for the connect timeout, which seemed to be a reasonable value fortheir purposes. However, if a developer sets `HttpClient.Timeout` to avalue *larger* than our defaults, `AndroidClientHandler` values "win" and theconnection/read time out earlier. The workaround is to set "our" timeouts alongwith the `HttpClient` one, but if the developer cannot do it, for any kind ofreasons (i.e. to avoid platform-specific code) then they are faced with anannoying situation.The real fix would be to improve `HttpClient` API so that its associated clienthandler can access `HttpClient` properties, but since it's not a quick fix wecan implement now, this commit bumps the default timeout values tothe (unreasonable) value of 24h to make sure we use values higher than the mostlikely figures assigned to `HttpClient.Timeout` and to match Xamarin.iOSNSUrlSessionHandler defaults.
@grendello
Copy link
ContributorAuthor

The Azure statuses are off - the builds have finished and are green

@jonathanpeppers
Copy link
Member

@jonpryorjonpryor merged commit0b79ab6 intodotnet:masterJul 5, 2019
@grendellogrendello deleted the silly-httpclienthandler-timeout branchJuly 5, 2019 17:24
jonathanpeppers pushed a commit that referenced this pull requestJul 9, 2019
Context:http://work.devdiv.io/911705Context:dotnet/macios@30d60bf`AndroidClientHandler` has no way of accessing the`HttpClient.Timeout` property in order to set the timeout value of*two* native http client properties (connect and read timeouts), soit uses two custom properties to provide these values.  So far, thevalues were set to 100 seconds for the read timeout and 120 secondsfor the connect timeout, which seemed to be a reasonable value fortheir purposes.However, if a developer sets `HttpClient.Timeout` to a value *larger*than our defaults, `AndroidClientHandler` values "win" and theconnection/read times out earlier.  The workaround is to set "our"timeouts along with the `HttpClient` one, but if the developer cannotdo it, for any kind of reasons (i.e. to avoid platform-specific code),then they are faced with an annoying situation.The real fix would be to improve `HttpClient` API so that itsassociated client handler can access `HttpClient` properties, but asthat's not a quick fix we can implement now, we instead bump thedefault timeout values to the (unreasonable) value of 24 hours tomake sure we use values higher than the most likely figures assignedto `HttpClient.Timeout`, and to match the Xamarin.iOS`NSUrlSessionHandler` defaults.
jonathanpeppers pushed a commit that referenced this pull requestJul 9, 2019
Context:http://work.devdiv.io/911705Context:dotnet/macios@30d60bf`AndroidClientHandler` has no way of accessing the`HttpClient.Timeout` property in order to set the timeout value of*two* native http client properties (connect and read timeouts), soit uses two custom properties to provide these values.  So far, thevalues were set to 100 seconds for the read timeout and 120 secondsfor the connect timeout, which seemed to be a reasonable value fortheir purposes.However, if a developer sets `HttpClient.Timeout` to a value *larger*than our defaults, `AndroidClientHandler` values "win" and theconnection/read times out earlier.  The workaround is to set "our"timeouts along with the `HttpClient` one, but if the developer cannotdo it, for any kind of reasons (i.e. to avoid platform-specific code),then they are faced with an annoying situation.The real fix would be to improve `HttpClient` API so that itsassociated client handler can access `HttpClient` properties, but asthat's not a quick fix we can implement now, we instead bump thedefault timeout values to the (unreasonable) value of 24 hours tomake sure we use values higher than the most likely figures assignedto `HttpClient.Timeout`, and to match the Xamarin.iOS`NSUrlSessionHandler` defaults.
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJan 30, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@jonathanpeppersjonathanpeppersjonathanpeppers approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@grendello@jonathanpeppers@jonpryor

[8]ページ先頭

©2009-2025 Movatter.jp