Title: ForEach-Object -Parallel situationally drops pipeline input · Issue #12801 · PowerShell/PowerShell · GitHub
Open Graph Title: ForEach-Object -Parallel situationally drops pipeline input · Issue #12801 · PowerShell/PowerShell
X Title: ForEach-Object -Parallel situationally drops pipeline input · Issue #12801 · PowerShell/PowerShell
Description: Note: I can only reproduce this reliably on macOS 10.15.4. I see it occasionally on Ubuntu 18.04, and can never reproduce it on Windows. It may be connected to using Start-Sleep inside the script block; not sure if the fact that a custom...
Open Graph Description: Note: I can only reproduce this reliably on macOS 10.15.4. I see it occasionally on Ubuntu 18.04, and can never reproduce it on Windows. It may be connected to using Start-Sleep inside the script b...
X Description: Note: I can only reproduce this reliably on macOS 10.15.4. I see it occasionally on Ubuntu 18.04, and can never reproduce it on Windows. It may be connected to using Start-Sleep inside the script b...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/12801
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ForEach-Object -Parallel situationally drops pipeline input","articleBody":"Note: I can only reproduce this _reliably_ on macOS 10.15.4.\r\nI see it _occasionally_ on Ubuntu 18.04, and can never reproduce it on Windows.\r\n\r\nIt may be connected to using `Start-Sleep` inside the script block; not sure if the fact that a _custom class_ is used across thread boundaries is relevant [_update_: [it is](https://github.com/PowerShell/PowerShell/issues/12801#issuecomment-634344380)]\r\n\r\n# Steps to reproduce\r\n\r\n```powershell\r\nclass Foo { static [object] Echo($val) { return $val } }\r\n$cls = [Foo]\r\nwhile ($true) { \r\n $res = 1..10 | ForEach-Object -Parallel {\r\n Start-Sleep -ms 100; ($using:cls)::echo($_) \r\n } | Sort-Object\r\n Compare-Object $res (1..10) | Should -BeNullOrEmpty\r\n Write-Host -NoNewline . \r\n}\r\n```\r\n\r\n# Expected behavior\r\n\r\nThe loop should run indefinitely, because the test should alway succeed.\r\n\r\n# Actual behavior\r\n\r\nThe loop eventually - after a varying number of iterations - breaks due to intermittent test failures, stemming from a missing output; e.g.:\r\n\r\n```none\r\nExpected $null or empty, but got @(@{InputObject=5; SideIndicator==\u003e})\r\n```\r\n\r\nThat is, not all input objects were echoed.\r\n\r\n# Environment data\r\n\r\n```none\r\nPowerShell Core 7.1.0-preview.3 on macOS 10.15.4\r\n```\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2020-05-26T22:14:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":17},"url":"https://github.com/12801/PowerShell/issues/12801"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ff9a816f-cc2b-c14b-7b38-a9dd49bf5e94 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D2EC:2E1F49:595C96:73C4C2:6A5BFDB1 |
| html-safe-nonce | 3fffcb9d4545d72b211d0398cdbf17f244484378ee4c1458c042f4fa559e3e5a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMkVDOjJFMUY0OTo1OTVDOTY6NzNDNEMyOjZBNUJGREIxIiwidmlzaXRvcl9pZCI6IjMyOTcwNTQ2MjQ2MzM4NDcyMTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3efa39c7f89d38c62cb680d8498d2115fe718490d8182a152f345c4f1cf89d9c |
| hovercard-subject-tag | issue:625233828 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/12801/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b8f734b0a1f8caf8a3f1a433327b982b7345707a0184a08cd0c68fff136f9bc5/PowerShell/PowerShell/issues/12801 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b8f734b0a1f8caf8a3f1a433327b982b7345707a0184a08cd0c68fff136f9bc5/PowerShell/PowerShell/issues/12801 |
| og:image:alt | Note: I can only reproduce this reliably on macOS 10.15.4. I see it occasionally on Ubuntu 18.04, and can never reproduce it on Windows. It may be connected to using Start-Sleep inside the script b... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mklement0 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width