Skip to content

Tokio hangs when opening TIFF #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
maxrjones opened this issue Apr 22, 2025 · 3 comments
Open

Tokio hangs when opening TIFF #89

maxrjones opened this issue Apr 22, 2025 · 3 comments

Comments

@maxrjones
Copy link
Member

This example seems to hang, @kylebarron suggested in may relate to the intersection between exceptions, panics, and async futures

from async_tiff import TIFF
from async_tiff.store import HTTPStore
from urllib.parse import urlparse
import asyncio

year = 2000
file_name = "50N_120W"
url = f"https://storage.googleapis.com/earthenginepartners-hansen/GLCLU2000-2020/v2/{year}/{file_name}.tif"
parsed = urlparse(url)
store = HTTPStore.from_url(f"{parsed.scheme}://{parsed.netloc}")
async def open_tiff(*, store, path):
    return await TIFF.open(path, store=store)

tiff = asyncio.run(open_tiff(store=store, path=parsed.path))
print(tiff)

fyi @TomNicholas

@kylebarron kylebarron changed the title Improve data loading using HTTPStore Tokio hangs when opening TIFF Apr 22, 2025
@kylebarron
Copy link
Member

FWIW I saw this issue apache/arrow-rs-object-store#343 which linked to this upstream issue rust-lang/rust#136932. When I was debugging this issue, I remember seeing a panic somewhere with u16::Display. I was super confused at the time, but I'm curious if maybe this was a regression with rustc? Maybe we should test with another rust version

@weiji14
Copy link
Member

weiji14 commented May 22, 2025

Tested on rust 1.86 and 1.87, getting the same hang behaviour on both so don't think it's related to those issues. I can reproduce this purely on the rust side too (when working on #101 (comment)), so at least we can deduce that it's not something with pyo3.

@kylebarron
Copy link
Member

kylebarron commented May 22, 2025

Yeah... I'm kinda stumped about this hanging 😔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants