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

Appearance settings

Invoke-RestMethod parallel problem #15513

Copy link
Copy link
@dperez83

Description

@dperez83
Issue body actions

Steps to reproduce

It happens randomly. Most of the time it works. Sometimes it fails and no other Invoke-RestMethod is possible after.

1..10 | ForEach-Object -Parallel { Invoke-RestMethod -Uri "www.google.com" -Headers @{
                 "method"="GET"
                 "scheme"="https"
                  } 
 } -ThrottleLimit 3

Expected behavior

To work everytime without the concurrent update error.

Actual behavior

Sometimes it returns the error bellow, and no further Invoke-RestMethod is possible in the session (it always returns the very same error) :

Invoke-RestMethod: Operations that change non-concurrent collections must have exclusive access. A concurrent update was performed on this collection and corrupted its state. The collection's state is no longer correct.

Environment data

Name                           Value
----                           -----
PSVersion                      7.1.3
PSEdition                      Core
GitCommitId                    7.1.3
OS                             Microsoft Windows 10.0.19043
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdlets-Corecmdlets in the Microsoft.PowerShell.Core modulecmdlets in the Microsoft.PowerShell.Core module

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.