René's URL Explorer Experiment


Title: StreamIDTooLowError when trying to send headers into closed stream · Issue #1175 · python-hyper/h2 · GitHub

Open Graph Title: StreamIDTooLowError when trying to send headers into closed stream · Issue #1175 · python-hyper/h2

X Title: StreamIDTooLowError when trying to send headers into closed stream · Issue #1175 · python-hyper/h2

Description: Hi! I'm getting errors like this on the server-side: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/grpclib/server.py", line 310, in request_handler await method.func(stream) File "/usr/local/lib/python3....

Open Graph Description: Hi! I'm getting errors like this on the server-side: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/grpclib/server.py", line 310, in request_handler await method.fu...

X Description: Hi! I'm getting errors like this on the server-side: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/grpclib/server.py", line 310, in request_handler a...

Opengraph URL: https://github.com/python-hyper/h2/issues/1175

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"StreamIDTooLowError when trying to send headers into closed stream","articleBody":"Hi!\r\n\r\nI'm getting errors like this on the server-side:\r\n```pytb\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.6/dist-packages/grpclib/server.py\", line 310, in request_handler\r\n    await method.func(stream)\r\n  File \"/usr/local/lib/python3.6/dist-packages/featureflags/server/rpc/service.py\", line 51, in Exchange\r\n    await self._queue.StoreStats.add(task, timeout=timeout)\r\n  File \"/usr/local/lib/python3.6/dist-packages/taskqueue/client/queue.py\", line 21, in add\r\n    await self._task_queue_stub.Add(task, timeout=timeout)\r\n  File \"/usr/local/lib/python3.6/dist-packages/grpclib/client.py\", line 473, in __call__\r\n    return await stream.recv_message()\r\n  File \"/usr/local/lib/python3.6/dist-packages/grpclib/client.py\", line 286, in recv_message\r\n    await self.recv_initial_metadata()\r\n  File \"/usr/local/lib/python3.6/dist-packages/grpclib/client.py\", line 221, in recv_initial_metadata\r\n    headers = await self._stream.recv_headers()\r\n  File \"/usr/local/lib/python3.6/dist-packages/grpclib/protocol.py\", line 215, in recv_headers\r\n    return await self.__headers__.get()\r\n  File \"/usr/lib/python3.6/asyncio/queues.py\", line 167, in get\r\n    yield from getter\r\nconcurrent.futures._base.CancelledError\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.6/dist-packages/h2/connection.py\", line 585, in _get_or_create_stream\r\n    return self.streams[stream_id]\r\nKeyError: 48141\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.6/dist-packages/grpclib/server.py\", line 325, in request_handler\r\n    raise\r\n  File \"/usr/local/lib/python3.6/dist-packages/grpclib/server.py\", line 220, in __aexit__\r\n    status_message=status_message)\r\n  File \"/usr/local/lib/python3.6/dist-packages/grpclib/server.py\", line 170, in send_trailing_metadata\r\n    await self._stream.send_headers(headers, end_stream=True)\r\n  File \"/usr/local/lib/python3.6/dist-packages/grpclib/protocol.py\", line 267, in send_headers\r\n    end_stream=end_stream)\r\n  File \"/usr/local/lib/python3.6/dist-packages/h2/connection.py\", line 763, in send_headers\r\n    stream_id, AllowedStreamIDs(self.config.client_side)\r\n  File \"/usr/local/lib/python3.6/dist-packages/h2/connection.py\", line 587, in _get_or_create_stream\r\n    return self._begin_new_stream(stream_id, allowed_ids)\r\n  File \"/usr/local/lib/python3.6/dist-packages/h2/connection.py\", line 454, in _begin_new_stream\r\n    raise StreamIDTooLowError(stream_id, highest_stream_id)\r\nh2.exceptions.StreamIDTooLowError: StreamIDTooLowError: 48141 is lower than 48143\r\n```\r\nThis happens when client cancels stream with RST_STREAM, and on the server-side I have a logic which looks like this:\r\n```python\r\ntry:\r\n    conn.send_headers(stream_id, [...])\r\nexcept h2.exceptions.StreamClosedError:\r\n    pass\r\n```\r\nAnd sometimes I'm getting `StreamIDTooLowError` exception instead of `StreamClosedError`, because this behavior depends on `H2Connection.streams` dictionary, where streams are removed nondeterministically.\r\n\r\nI think that `H2Connection._get_or_create_stream` function should check not only `H2Connection.streams` but also `H2Connection._closed_streams`.\r\n\r\nOf course I can refactor my code and check that stream is closed by myself, but I still think that there is a bug in `H2Connection.send_headers` method.","author":{"url":"https://github.com/vmagamedov","@type":"Person","name":"vmagamedov"},"datePublished":"2018-10-25T13:13:42Z","url":"https://github.com/python-hyper/h2/issues/1175"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:bbd582f3-96c7-f1a1-88df-0d0df4a77fc4
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEB0A:17A21E:36F198D:499F40C:6B06EF9D
html-safe-nonce90419d727c33b13f6e88338397f37044b448bde2060d05835378535cb7c77f1b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjBBOjE3QTIxRTozNkYxOThEOjQ5OUY0MEM6NkIwNkVGOUQiLCJ2aXNpdG9yX2lkIjoiODU3MDg4MTMwNzEyMTc0MTcyNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacb412c216f513007e8152472cb3ff38f03c0af38d609624181335fda490f3eb00
hovercard-subject-tagissue:373940872
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-hyper/h2/1175/issue_layout
twitter:imagehttps://opengraph.githubassets.com/069dce1c652f45c6adf59d0dd3f1ff69af2258323ce1889b5a2faee8732d797d/python-hyper/h2/issues/1175
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/069dce1c652f45c6adf59d0dd3f1ff69af2258323ce1889b5a2faee8732d797d/python-hyper/h2/issues/1175
og:image:altHi! I'm getting errors like this on the server-side: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/grpclib/server.py", line 310, in request_handler await method.fu...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamevmagamedov
hostnamegithub.com
expected-hostnamegithub.com
None351ea5ca38a5758919d44ee52c70fe9003c0c2dfa20f04effd7fac0c5330c16b
turbo-cache-controlno-preview
go-importgithub.com/python-hyper/h2 git https://github.com/python-hyper/h2.git
octolytics-dimension-user_id13035907
octolytics-dimension-user_loginpython-hyper
octolytics-dimension-repository_id37996233
octolytics-dimension-repository_nwopython-hyper/h2
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id37996233
octolytics-dimension-repository_network_root_nwopython-hyper/h2
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
release891bde3f438884e9c6c7ccd826f33805910a978b
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python-hyper/h2/issues/1175#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-hyper%2Fh2%2Fissues%2F1175
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-hyper%2Fh2%2Fissues%2F1175
Sign uphttps://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-hyper%2Fh2
Reloadhttps://github.com/python-hyper/h2/issues/1175
Reloadhttps://github.com/python-hyper/h2/issues/1175
Reloadhttps://github.com/python-hyper/h2/issues/1175
python-hyperhttps://github.com/python-hyper
h2https://github.com/python-hyper/h2
Codehttps://github.com/python-hyper/h2
Issues21 (21)https://github.com/python-hyper/h2/issues
Pull requests23 (23)https://github.com/python-hyper/h2/pulls
Actionshttps://github.com/python-hyper/h2/actions
Projectshttps://github.com/python-hyper/h2/projects
Wikihttps://github.com/python-hyper/h2/wiki
Security and quality2 (2)https://github.com/python-hyper/h2/security
Insightshttps://github.com/python-hyper/h2/insights
https://github.com/python-hyper/h2
New issuehttps://github.com/login?return_to=https://github.com/python-hyper/h2/issues/1175
New issuehttps://github.com/login?return_to=https://github.com/python-hyper/h2/issues/1175
#1323https://github.com/python-hyper/h2/pull/1323
StreamIDTooLowError when trying to send headers into closed streamhttps://github.com/python-hyper/h2/issues/1175#top
#1323https://github.com/python-hyper/h2/pull/1323
https://github.com/vmagamedov
vmagamedovhttps://github.com/vmagamedov
on Oct 25, 2018https://github.com/python-hyper/h2/issues/1175#issue-373940872
https://github.com/vmagamedov
vmagamedovhttps://github.com/vmagamedov
on Oct 25, 2018https://github.com/python-hyper/h2/issues/1175#issuecomment-433051572
Sign up for freehttps://github.com/signup?return_to=https://github.com/python-hyper/h2/issues/1175
Sign in to commenthttps://github.com/login?return_to=https://github.com/python-hyper/h2/issues/1175
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.