DNS lookups survive cancellation
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 18/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- networking
Research direction
Start with the attached dns_probe.py and stall_dns.c reproduction to confirm that timed-out DNS lookups keep Tokio blocking threads busy. Then trace where list_async schedules the underlying blocking lookup in the Rust layer to see whether cancellation drops the future without stopping the lookup. The reporter expects the real fix upstream in object_store, so this is investigation-first rather than a contained patch; done means the reproduction no longer exhausts the process-wide blocking pool and unrelated stores stop timing out.
Written by the indexing model from the issue text.
Description
Hi,
when requests timeout, they can leave behind stalled DNS lookups occupying Tokio's blocking threadpool tasks.
I have a long-running polling loop roughly like this in pseudocode
async def poll_source(store):
while True:
try:
ls = await store.list_async(dir, timeout=...).collect_async()
await process_new_files(ls)
except TimeoutError:
log.error(...)
await asyncio.sleep(10)
await asyncio.gather(*(poll_source(store)) for store in stores))
I noticed that if the process is running long enough, all of the pollers eventually start timeouting forever in my setup, even though the code looks quite safe.
It may be possible that stalled DNS threads are accumulating and eventually exhaust the threadpool.
The threadpool is process-wide, so even requests to unrelated MemoryStore start timing out.
While looking for the cause, it has been revealed to me that there is this reproducible DNS failure mode that fits the observed behavior of my service, though I do not know whether it is responsible for my service failure.
The workaround for me is clear now, just restart the service whenever it happens, but I thought the bug is worth reporting. It seems that a proper fix would need to be upstream in object_store.
AI disclosure: the bug has been found and reproduced by AI
I attach an AI generated write up and reproduction scripts
- Dominant language
- Python
- Stars
- 842
- Forks
- 50
- Avg merge
- 9h
- Merged PRs (30d)
- 13
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from developmentseed/obstore
-
fsspec: `get_file` silently writes nothing for `file://` and Windows pathsPossibly taken @andyhetianjun claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 58/100
developmentseed/obstore#830 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
developmentseed/obstore#823 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
developmentseed/obstore#819 ·
Maintainers usually reply within 1 day
-
`put_async(Path)` opens files synchronously while holding the GILPossibly taken @kylebarron claimed this 14 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
developmentseed/obstore#809 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 75/100
developmentseed/obstore#779 · 5 comments ·
Maintainers usually reply within 1 day
All issues in developmentseed/obstore
Similar issues
-
Task select patterns with uppercase letters never matchPossibly taken @manobhisriram claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
app: scripts status: backlog type: housekeeping
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
netbox-community/netbox-scripts#239 ·
Maintainers usually reply within 1 day
-
Lambda deploys fail once the bundle grows by about 254 KBPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
developmentseed/titiler-cmr#341 ·
Maintainers usually reply within 1 day
-
Card tables add "..." to every value in a DataFrame column when any value is longer than 30 charactersPossibly taken @omkarbandikatte claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day