Title: `concurrent.futures.Executor.map` temporarily exceeds its `buffersize` while collecting the next result · Issue #131466 · python/cpython · GitHub
Open Graph Title: `concurrent.futures.Executor.map` temporarily exceeds its `buffersize` while collecting the next result · Issue #131466 · python/cpython
X Title: `concurrent.futures.Executor.map` temporarily exceeds its `buffersize` while collecting the next result · Issue #131466 · python/cpython
Description: Bug report Bug description: Potential follow up after the merge of #125663 (introduce buffersize param in Executor.map). "Bug": concurrent.futures.Executor.map temporarily exceeds its buffersize while collecting the next result: Let's de...
Open Graph Description: Bug report Bug description: Potential follow up after the merge of #125663 (introduce buffersize param in Executor.map). "Bug": concurrent.futures.Executor.map temporarily exceeds its buffersize wh...
X Description: Bug report Bug description: Potential follow up after the merge of #125663 (introduce buffersize param in Executor.map). "Bug": concurrent.futures.Executor.map temporarily exceeds its buf...
Opengraph URL: https://github.com/python/cpython/issues/131466
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`concurrent.futures.Executor.map` temporarily exceeds its `buffersize` while collecting the next result","articleBody":"# Bug report\n\n### Bug description:\n\nPotential follow up after the merge of #125663 (introduce `buffersize` param in `Executor.map`).\n\n**\"Bug\": `concurrent.futures.Executor.map` temporarily exceeds its `buffersize` while collecting the next result:**\n\nLet's define:\n```python\nresults: Iterator = executor.map(fn, iterable, buffersize=buffersize)\n```\n\n**What happens when calling `next(results)`:**\n1. fetch the next `arg` from `interable` and put a task for `fn(arg)` in the buffer\n2. wait for next result to be available\n3. yield the collected result\n\nSo during step 2. the buffer's size is actually `buffersize + 1`.\n\nIf we want a strict guarantee that there is at most `buffersize` concurrent tasks even during a `next`, we have to **swap step 1. and step 2.**\n\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-131467\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/ebonnal","@type":"Person","name":"ebonnal"},"datePublished":"2025-03-19T15:53:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/131466/cpython/issues/131466"}
| 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:2714b564-87b1-ebdc-e429-ac43c3cd3b9f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DEAA:110F0E:368983:47677B:698EAF08 |
| html-safe-nonce | 9d0b7e5c6f389c146afc18a4c8f7fdaf9e322d32003de5a6d119c48591b19f87 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERUFBOjExMEYwRTozNjg5ODM6NDc2NzdCOjY5OEVBRjA4IiwidmlzaXRvcl9pZCI6IjcxNDAxODQzMDAxNTQ5NTc1NzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9a7a9288967f09fc680502d1ae49500cbc4ba2e4299ea28a71a9d74f54824cf7 |
| hovercard-subject-tag | issue:2932312504 |
| 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/python/cpython/131466/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7d8223356b394f8b7503cf956aa54173881a1904745e9630f3e81b00cee3a038/python/cpython/issues/131466 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7d8223356b394f8b7503cf956aa54173881a1904745e9630f3e81b00cee3a038/python/cpython/issues/131466 |
| og:image:alt | Bug report Bug description: Potential follow up after the merge of #125663 (introduce buffersize param in Executor.map). "Bug": concurrent.futures.Executor.map temporarily exceeds its buffersize wh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ebonnal |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb2828a801ee6b7be618f3ac76fbf55def35bbc30f053a9c41bf90210b8b72ba |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| 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 | e6b91a7e6e46287d26887e3fb7a4161657bab8f7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width