Sitelet https://github.com/JustinGrote/ModuleFast/issues/85
Skip to content

Allow Configurable Timeout for HTTPS Sessions #85

Description

@jbogard

I'm trying to run in Azure DevOps environments and getting frequent timeouts:

Install-ModuleFast : The request was canceled due to the configured HttpClient.Timeout of 30 seconds elapsing.

The script I'm running:

iwr bit.ly/modulefast | iex

Install-ModuleFast 'Az','Az.Accounts','SqlServer' -CI

It fails intermittently locally as well with timeout errors. Is it possible to configure this timeout?

Activity

  1. JustinGrote commented on May 22, 2024

    @JustinGrote
    Owner

    So ModuleFast doesn't have much error correction at the moment. If one of your requests doesn't receive a response, it doesn't attempt a retry, it simply times out, so if your network is not stable then it's not going to be a good solution. I do hope to add some basic retry logic but it's difficult given the optimized task nature and still using PowerShell. Thanks for the report!

  2. changed the title [-]HttpClient timeouts in CI builds[/-] [+]Add Retry Support to HTTPS calls[/+] on May 22, 2024
  3. JustinGrote commented on May 22, 2024

    @JustinGrote
    Owner

    fails intermittently locally as well with timeout errors. Is it possible to configure this timeout?

    The timeout should be configurable, but also, do you really need the entire Az module for your pipeline? If you choose a subset of modules it'll go way faster.

  4. jbogard commented on May 22, 2024

    @jbogard
    Author

    Yes evidently the consensus on Twitter for the Az module is "don't install that". Dunno why so many tutorials suggested that!

    When I just used the modules I actually needed, it went just fine.

  5. JustinGrote commented on May 22, 2024

    @JustinGrote
    Owner

    @jbogard there is a known issue where the httpclient starts the timer from the point I create the task, and if you're on a slow system downloading a LOT of modules, that task can get "queued" and timeout before it even actually is downloading anything. Haven't found any way in httpclient to fix this directly, but I think the ThrottleLimit parameter can help.

  6. jborean93 commented on Jul 8, 2024

    @jborean93

    Started to come across this in my GHA CI pipelines. A quick and dirty fix would be to expose the TimeOut value as a parameter on Install-ModuleFast so

    $httpClient.Timeout = [TimeSpan]::FromSeconds(30)
    is not hardcoded and we can just increase it a bit.

    Going forward a retry mechanism would be great or changing the defaults to the connect operation is 30 seconds but the subsequent reads after the socket is connected being more than 30 seconds might be ideal.

  7. changed the title [-]Add Retry Support to HTTPS calls[/-] [+]Allow Configurable Timeout for HTTPS Sessions[/+] on Jul 15, 2024
  8. self-assigned this
    on Jul 15, 2024
  9. added a commit that references this issue on Jul 15, 2024
    4e5ced3
  10. added a commit that references this issue on Aug 22, 2024
    82bf7ec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions