sdk-container-builds icon indicating copy to clipboard operation
sdk-container-builds copied to clipboard

Provide a way to adjust the httpclient timeout for layer pushes

Open baronfel opened this issue 1 year ago • 9 comments

Users aren't always in control of their network - we should provide some way for them to override the default .NET timeout for uploads (100s). This pops up in a few places, like https://github.com/Azure/azure-dev/discussions/3212.

Thoughts:

  • since the user can cancel the operation at any time, should we just set an infinite timeout? If we do, we will likely need to adapt all existing callsites for the small operations to have short timeouts to prevent hangs. The Timeout in the HttpClient is used to create a linked cancellationToken that cancels after that duration, so we can orchestrate the same here - or simply use the new WaitAsync(TimeSpan) methods on Task<T> to make that super clear.
    • Note that if we use the generic WaitAsync, those throw TimeoutExceptions with little detail, so we should handle them and make them say something useful.

cc @rainersigwald @MichalPavlik

baronfel avatar Jan 25 '24 16:01 baronfel

got the same issue, see https://github.com/Azure/azure-dev/issues/3225#top

BartNetJS avatar Jan 25 '24 16:01 BartNetJS

This also bit @mitchdenny hard today.

baronfel avatar Feb 20 '24 20:02 baronfel

Customers are hitting this repeatedly on the linked issue. We may need to bump priority + backport to 8.0.200 since Aspire is using that feature branch.

cc @MichalPavlik / @rokonec / @rainersigwald

baronfel avatar Feb 21 '24 20:02 baronfel

I wonder if the issue isn't caused by the SDK not doing chunked uploads, see https://github.com/Azure/azure-dev/discussions/3212#discussioncomment-8553439.

tmds avatar Feb 23 '24 05:02 tmds

We've got a hotfix in for 8.0.200 servicing and 8.0.300, but we should have some more usable knob. Moving this to the next milestone as a result.

baronfel avatar Apr 16 '24 14:04 baronfel

@baronfel is a fix for this in 8.0.1xx?

DamianEdwards avatar May 31 '24 01:05 DamianEdwards

No, I'm not sure why I didn't backport that far originally. Folks using 1xx can use the nuget packages for a workaround now, however.

baronfel avatar May 31 '24 01:05 baronfel

I kicked a backport off that I can get servicing approval for over email.

baronfel avatar May 31 '24 01:05 baronfel

Backport is https://github.com/dotnet/sdk/pull/41294

baronfel avatar May 31 '24 01:05 baronfel

The knob seems to be usable enough for users so far. We'll close this and reopen if there is evidence of further need.

baronfel avatar Oct 09 '24 15:10 baronfel