René's URL Explorer Experiment


Title: Nostr relay service retries unreachable relays with no backoff, exhausting the ESP32 thread pool and breaking other apps' networking · Issue #191 · MicroPythonOS/MicroPythonOS · GitHub

Open Graph Title: Nostr relay service retries unreachable relays with no backoff, exhausting the ESP32 thread pool and breaking other apps' networking · Issue #191 · MicroPythonOS/MicroPythonOS

X Title: Nostr relay service retries unreachable relays with no backoff, exhausting the ESP32 thread pool and breaking other apps' networking · Issue #191 · MicroPythonOS/MicroPythonOS

Description: Summary The background Nostr service (com.micropythonos.nostr, nostr_boot_service) retries unreachable relays with no backoff. On a Fri3d 2024 badge this drained the ESP32-S3 thread pool and broke other apps' networking — The Free Lanter...

Open Graph Description: Summary The background Nostr service (com.micropythonos.nostr, nostr_boot_service) retries unreachable relays with no backoff. On a Fri3d 2024 badge this drained the ESP32-S3 thread pool and broke ...

X Description: Summary The background Nostr service (com.micropythonos.nostr, nostr_boot_service) retries unreachable relays with no backoff. On a Fri3d 2024 badge this drained the ESP32-S3 thread pool and broke ...

Opengraph URL: https://github.com/MicroPythonOS/MicroPythonOS/issues/191

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Nostr relay service retries unreachable relays with no backoff, exhausting the ESP32 thread pool and breaking other apps' networking","articleBody":"## Summary\n\nThe background Nostr service (`com.micropythonos.nostr`, `nostr_boot_service`) retries unreachable relays with no backoff. On a Fri3d 2024 badge this drained the ESP32-S3 thread pool and broke **other apps' networking** — The Free Lantern Player could not fetch fragments during playback and the audio broke up badly.\n\n## What happens\n\nThe service connects to three relays that are currently failing:\n\n```\nERROR:nostr.relay:relay error wss://relay.damus.io: b'HTTP/1.1 522 '\nERROR:uaiowebsocket:_async_main's await self._connect_and_run() for wss://relay.primal.net got exception: -113\nERROR:uaiowebsocket:_async_main's await self._connect_and_run() for wss://relay.0xchat.com got exception: -113\n```\n\nIt reconnects immediately and continuously. Each connection attempt resolves the relay host via `async_dns.getaddrinfo_async`, which spawns a `_thread` per lookup. With no backoff, the retries spawn resolver threads faster than the small ESP32-S3 pool allows, and it exhausts:\n\n```\nWARNING:notification_manager:Failed to play notification sound: can't create thread\n...\nFile \"mpos/net/async_dns.py\", line 106, in getaddrinfo_async\nOSError: can't create thread\nTFLPlayer prefetch error (retrying): can't create thread\nERROR:nostr.relay:relay error wss://relay.damus.io: can't create thread\n```\n\nAt that point `_thread.start_new_thread` fails everywhere on the device (I confirmed a bare `_thread.start_new_thread` from the REPL also raised `can't create thread`). Disabling the Nostr boot service made the pool healthy again and TFL streamed smoothly.\n\n## Root cause / two fixes\n\n1. **DNS re-resolution per attempt** (the thread-exhaustion trigger). A DNS cache in `async_dns` removes this: retries reuse the cached relay IP instead of spawning a resolver thread each time. Submitted as #189 — it makes the retries pure-async and stops the thread starvation for Nostr and any other repeat-lookup workload.\n\n2. **No relay backoff** (the remaining waste). Even with the DNS cache, the service still hammers unreachable relays as fast as it can, wasting CPU and network. It should back off on failed connections (e.g. exponential backoff per relay, capped), so a set of down relays does not spin the event loop.\n\nFix #1 (via #189) stops it from breaking other apps; fix #2 is the proper behavior for the service itself.\n\n## Environment\n\n- Fri3d 2024 badge, MicroPythonOS reporting BuildInfo 0.14.2 (flashed via the web flasher labelled \"1.0.4\").\n","author":{"url":"https://github.com/jnuyens","@type":"Person","name":"jnuyens"},"datePublished":"2026-07-09T20:14:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/191/MicroPythonOS/issues/191"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d56e4ad5-a05d-b917-4758-34e9623ec21d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA8AE:2BA38A:5731B3:751B34:6A5346D4
html-safe-nonceee55d4b2c5a85cdbf15c3ba97b44f363039424f651ef84aee11fbbdff1ac675b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOEFFOjJCQTM4QTo1NzMxQjM6NzUxQjM0OjZBNTM0NkQ0IiwidmlzaXRvcl9pZCI6IjM4NzM0MzM3NzY4NTMwNDI5MDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd598da8b6a85f3e8ae979fca04ed59865a9daacd5ed00e0034f82f94e8b69822
hovercard-subject-tagissue:4849579624
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/MicroPythonOS/MicroPythonOS/191/issue_layout
twitter:imagehttps://opengraph.githubassets.com/67c83ab982249087750f089f92be51fcde6a638ded42805bf551b426ff2e0750/MicroPythonOS/MicroPythonOS/issues/191
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/67c83ab982249087750f089f92be51fcde6a638ded42805bf551b426ff2e0750/MicroPythonOS/MicroPythonOS/issues/191
og:image:altSummary The background Nostr service (com.micropythonos.nostr, nostr_boot_service) retries unreachable relays with no backoff. On a Fri3d 2024 badge this drained the ESP32-S3 thread pool and broke ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejnuyens
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
go-importgithub.com/MicroPythonOS/MicroPythonOS git https://github.com/MicroPythonOS/MicroPythonOS.git
octolytics-dimension-user_id213598128
octolytics-dimension-user_loginMicroPythonOS
octolytics-dimension-repository_id975472483
octolytics-dimension-repository_nwoMicroPythonOS/MicroPythonOS
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id975472483
octolytics-dimension-repository_network_root_nwoMicroPythonOS/MicroPythonOS
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
release07a982c1d40157c619b364352b704c3ce66bb332
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/MicroPythonOS/MicroPythonOS/issues/191#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FMicroPythonOS%2FMicroPythonOS%2Fissues%2F191
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
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
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
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/enterprise/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%2FMicroPythonOS%2FMicroPythonOS%2Fissues%2F191
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=MicroPythonOS%2FMicroPythonOS
Reloadhttps://github.com/MicroPythonOS/MicroPythonOS/issues/191
Reloadhttps://github.com/MicroPythonOS/MicroPythonOS/issues/191
Reloadhttps://github.com/MicroPythonOS/MicroPythonOS/issues/191
Please reload this pagehttps://github.com/MicroPythonOS/MicroPythonOS/issues/191
MicroPythonOS https://github.com/MicroPythonOS
MicroPythonOShttps://github.com/MicroPythonOS/MicroPythonOS
Notifications https://github.com/login?return_to=%2FMicroPythonOS%2FMicroPythonOS
Fork 83 https://github.com/login?return_to=%2FMicroPythonOS%2FMicroPythonOS
Star 737 https://github.com/login?return_to=%2FMicroPythonOS%2FMicroPythonOS
Code https://github.com/MicroPythonOS/MicroPythonOS
Issues 23 https://github.com/MicroPythonOS/MicroPythonOS/issues
Pull requests 7 https://github.com/MicroPythonOS/MicroPythonOS/pulls
Discussions https://github.com/MicroPythonOS/MicroPythonOS/discussions
Actions https://github.com/MicroPythonOS/MicroPythonOS/actions
Projects https://github.com/MicroPythonOS/MicroPythonOS/projects
Security and quality 0 https://github.com/MicroPythonOS/MicroPythonOS/security
Insights https://github.com/MicroPythonOS/MicroPythonOS/pulse
Code https://github.com/MicroPythonOS/MicroPythonOS
Issues https://github.com/MicroPythonOS/MicroPythonOS/issues
Pull requests https://github.com/MicroPythonOS/MicroPythonOS/pulls
Discussions https://github.com/MicroPythonOS/MicroPythonOS/discussions
Actions https://github.com/MicroPythonOS/MicroPythonOS/actions
Projects https://github.com/MicroPythonOS/MicroPythonOS/projects
Security and quality https://github.com/MicroPythonOS/MicroPythonOS/security
Insights https://github.com/MicroPythonOS/MicroPythonOS/pulse
Nostr relay service retries unreachable relays with no backoff, exhausting the ESP32 thread pool and breaking other apps' networkinghttps://github.com/MicroPythonOS/MicroPythonOS/issues/191#top
https://github.com/jnuyens
jnuyenshttps://github.com/jnuyens
on Jul 9, 2026https://github.com/MicroPythonOS/MicroPythonOS/issues/191#issue-4849579624
feat(net): cache async DNS resolutions to reuse across requests #189https://github.com/MicroPythonOS/MicroPythonOS/pull/189
#1https://github.com/MicroPythonOS/MicroPythonOS/issues/1
#189https://github.com/MicroPythonOS/MicroPythonOS/pull/189
#2https://github.com/MicroPythonOS/MicroPythonOS/issues/2
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.