René's URL Explorer Experiment


Title: Issue with Python 3.11 and dask[distributed] with high number of threads · Issue #116969 · python/cpython · GitHub

Open Graph Title: Issue with Python 3.11 and dask[distributed] with high number of threads · Issue #116969 · python/cpython

X Title: Issue with Python 3.11 and dask[distributed] with high number of threads · Issue #116969 · python/cpython

Description: Bug report Bug description: I have noticed that the dask benchmark in pyperformance hangs when running it with Python 3.11 with a "high" number of cores on the machine. I have seen issues with 191 and 384 cores. I started investigated th...

Open Graph Description: Bug report Bug description: I have noticed that the dask benchmark in pyperformance hangs when running it with Python 3.11 with a "high" number of cores on the machine. I have seen issues with 191 ...

X Description: Bug report Bug description: I have noticed that the dask benchmark in pyperformance hangs when running it with Python 3.11 with a "high" number of cores on the machine. I have seen issues...

Opengraph URL: https://github.com/python/cpython/issues/116969

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Issue with Python 3.11 and dask[distributed] with high number of threads","articleBody":"# Bug report\r\n\r\n### Bug description:\r\n\r\nI have noticed that the dask benchmark in pyperformance hangs when running it with Python 3.11 with a \"high\" number of cores on the machine. I have seen issues with 191 and 384 cores.\r\n\r\nI started investigated the problem and seen that the issue manifested itself on a machine with a high number of cores.\r\nThe benchmarks that hangs is https://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_dask/run_benchmark.py\r\n\r\nWhen the Worker class get instantiated, it sets the nthreads to the number of CPUs present on the system ([here the code](https://github.com/dask/distributed/blob/2022.02.0/distributed/worker.py#L840))\r\n\r\nWhen this number is relatively high, it causes Python3.11 to hang and all the underlying threads to deadlock on the GIL.\r\n\r\nTo replicate the issue:\r\n* make a copy of the dask [benchmark file](https://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_dask/run_benchmark.py)\r\n* set the nthreads of the Worker class to a relatively high number (E.g. 1000).\r\n```\r\nasync with Worker(scheduler.address, nthreads=1000):\r\n...\r\n```\r\n* Create/activate a venv with Python 3.11 and install the dependencies\r\n```\r\npip install dask[distributed]==2022.2.0 pyperf\r\n```\r\n* Run a quick stress test\r\n```\r\nwhile true; do python run_benchmark.py; done \r\n```\r\nand wait to hang. It does it at random time.\r\n\r\nWith the process hanging, gdb shows on a thread (out of the hundreds):\r\n```\r\n (gdb) thread 4\r\n[Switching to thread 4 (Thread 0x7f5aeffff640 (LWP 402351))]\r\n#0  __futex_abstimed_wait_common64 (private=-1457409528, cancel=true, abstime=0x7f5aefffde20, op=137, expected=0, futex_word=0x5640a959d354 \u003c_PyRuntime+436\u003e) at ./nptl/futex-internal.c:57\r\n57      in ./nptl/futex-internal.c\r\n(gdb) py-bt\r\nTraceback (most recent call first):\r\n  Waiting for the GIL\r\n  File \"/home/ent-user/venv/cpython3.11-324490c70469-compat-2d3356be745c/lib/python3.11/site-packages/psutil/_common.py\", line 788, in open_binary\r\n    return open(fname, \"rb\", buffering=FILE_READ_BUFFER_SIZE)\r\n  File \"/home/ent-user/venv/cpython3.11-324490c70469-compat-2d3356be745c/lib/python3.11/site-packages/psutil/_pslinux.py\", line 1967, in memory_info\r\n    with open_binary(\"%s/%s/statm\" % (self._procfs_path, self.pid)) as f:\r\n  File \"/home/ent-user/venv/cpython3.11-324490c70469-compat-2d3356be745c/lib/python3.11/site-packages/psutil/_pslinux.py\", line 1714, in wrapper\r\n    return fun(self, *args, **kwargs)\r\n  File \"/home/ent-user/venv/cpython3.11-324490c70469-compat-2d3356be745c/lib/python3.11/site-packages/psutil/__init__.py\", line 1102, in memory_info\r\n    return self._proc.memory_info()\r\n  File \"/home/ent-user/venv/cpython3.11-324490c70469-compat-2d3356be745c/lib/python3.11/site-packages/psutil/_common.py\", line 495, in wrapper\r\n    return fun(self)\r\n  File \"/home/ent-user/venv/cpython3.11-324490c70469-compat-2d3356be745c/lib/python3.11/site-packages/distributed/utils_perf.py\", line 188, in _gc_callback\r\n    rss = self._proc.memory_info().rss\r\n  \u003cbuilt-in method _current_frames of module object at remote 0x7f5dc0a32ca0\u003e\r\n  File \"/home/ent-user/venv/cpython3.11-324490c70469-compat-2d3356be745c/lib/python3.11/site-packages/distributed/profile.py\", line 270, in _watch\r\n    frame = sys._current_frames()[thread_id]\r\n  File \"/home/ent-user/ci-scripts/tmpdir/prefix/lib/python3.11/threading.py\", line 982, in run\r\n    self._target(*self._args, **self._kwargs)\r\n  File \"/home/ent-user/ci-scripts/tmpdir/prefix/lib/python3.11/threading.py\", line 1045, in _bootstrap_inner\r\n    self.run()\r\n  File \"/home/ent-user/ci-scripts/tmpdir/prefix/lib/python3.11/threading.py\", line 1002, in _bootstrap\r\n    self._bootstrap_inner()\r\n```\r\n\r\nA strace of a thread shows (continuously)\r\n```\r\n...\r\nfutex(0x55707e87f350, FUTEX_WAIT_BITSET_PRIVATE, 0, {tv_sec=6498067, tv_nsec=468031783}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)\r\nfutex(0x55707e87f358, FUTEX_WAKE_PRIVATE, 1) = 0\r\nfutex(0x55707e87f350, FUTEX_WAIT_BITSET_PRIVATE, 0, {tv_sec=6498067, tv_nsec=473122144}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)\r\nfutex(0x55707e87f358, FUTEX_WAKE_PRIVATE, 1) = 0\r\nfutex(0x55707e87f350, FUTEX_WAIT_BITSET_PRIVATE, 0, {tv_sec=6498067, tv_nsec=478228035}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)\r\nfutex(0x55707e87f358, FUTEX_WAKE_PRIVATE, 1) = 0\r\nfutex(0x55707e87f350, FUTEX_WAIT_BITSET_PRIVATE, 0, {tv_sec=6498067, tv_nsec=483319687}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)\r\nfutex(0x55707e87f358, FUTEX_WAKE_PRIVATE, 1) = 0\r\nfutex(0x55707e87f350, FUTEX_WAIT_BITSET_PRIVATE, 0, {tv_sec=6498067, tv_nsec=488417438}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)\r\nfutex(0x55707e87f358, FUTEX_WAKE_PRIVATE, 1) = 0\r\nfutex(0x55707e87f350, FUTEX_WAIT_BITSET_PRIVATE, 0, {tv_sec=6498067, tv_nsec=493521779}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)\r\nfutex(0x55707e87f358, FUTEX_WAKE_PRIVATE, 1) = 0\r\nfutex(0x55707e87f350, FUTEX_WAIT_BITSET_PRIVATE, 0, {tv_sec=6498067, tv_nsec=498608771}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)\r\nfutex(0x55707e87f358, FUTEX_WAKE_PRIVATE, 1) = 0\r\nfutex(0x55707e87f350, FUTEX_WAIT_BITSET_PRIVATE, 0, {tv_sec=6498067, tv_nsec=503711922}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)\r\nfutex(0x55707e87f358, FUTEX_WAKE_PRIVATE, 1) = 0\r\nfutex(0x55707e87f350, FUTEX_WAIT_BITSET_PRIVATE, 0, {tv_sec=6498067, tv_nsec=508813993}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)\r\nfutex(0x55707e87f358, FUTEX_WAKE_PRIVATE, 1) = 0\r\nfutex(0x55707e87f350, FUTEX_WAIT_BITSET_PRIVATE, 0, {tv_sec=6498067, tv_nsec=513919325}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)\r\nfutex(0x55707e87f358, FUTEX_WAKE_PRIVATE, 1) = 0\r\nfutex(0x55707e87f350, FUTEX_WAIT_BITSET_PRIVATE, 0, {tv_sec=6498067, tv_nsec=519022166}, FUTEX_BITSET_MATCH_ANY) = -1 ETIMEDOUT (Connection timed out)\r\n...\r\n```\r\n\r\nI tried upgrading Dask[distributed] the latest version but I have the same effects. I think there is something going on in Python 3.11.\r\nThis happens only with Python 3.11: 3.9 and 3.12 work as expected.\r\n\r\nI've seen it on x86, aarch64 still to test.\r\n\r\n### CPython versions tested on:\r\n\r\n3.11\r\n\r\n### Operating systems tested on:\r\n\r\nLinux","author":{"url":"https://github.com/diegorusso","@type":"Person","name":"diegorusso"},"datePublished":"2024-03-18T18:58:52.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/116969/cpython/issues/116969"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:634cd4f6-e579-ff8f-3842-6f9ef252fc83
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD32E:15DFF5:1B85F17:25E246C:696AB5F6
html-safe-nonce455f0e28711c6354174423cfd428bcb0b9fc5ffc48ba6fc9ed1110d88558701c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzJFOjE1REZGNToxQjg1RjE3OjI1RTI0NkM6Njk2QUI1RjYiLCJ2aXNpdG9yX2lkIjoiNzg0ODM4MjYwNDM0NjMwODA4NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc75e475eed8eb1efff11dffc352dcfa2b22f6f5d815ed0c5d837b1d7a407ee14
hovercard-subject-tagissue:2193029935
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/116969/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1260622cdc196b7dbe56fd3bbb12a9c52cd43a02138d6d12db964b45c683b025/python/cpython/issues/116969
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1260622cdc196b7dbe56fd3bbb12a9c52cd43a02138d6d12db964b45c683b025/python/cpython/issues/116969
og:image:altBug report Bug description: I have noticed that the dask benchmark in pyperformance hangs when running it with Python 3.11 with a "high" number of cores on the machine. I have seen issues with 191 ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamediegorusso
hostnamegithub.com
expected-hostnamegithub.com
None46ce962e0e18113ea447391b6ace8b02d4d2861e57b4fbab3658698f73d8855b
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release30300f30bb3949de255e84a146706a3bdb5c19c9
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/116969#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F116969
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F116969
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/116969
Reloadhttps://github.com/python/cpython/issues/116969
Reloadhttps://github.com/python/cpython/issues/116969
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/116969
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/issues/116969
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/116969
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/116969
Issue with Python 3.11 and dask[distributed] with high number of threadshttps://github.com/python/cpython/issues/116969#top
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/diegorusso
https://github.com/diegorusso
diegorussohttps://github.com/diegorusso
on Mar 18, 2024https://github.com/python/cpython/issues/116969#issue-2193029935
https://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_dask/run_benchmark.pyhttps://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_dask/run_benchmark.py
here the codehttps://github.com/dask/distributed/blob/2022.02.0/distributed/worker.py#L840
benchmark filehttps://github.com/python/pyperformance/blob/main/pyperformance/data-files/benchmarks/bm_dask/run_benchmark.py
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.