You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dumping this less than complete bug report here. I'll try to fill in more details later.
We're using FsspecStacIO via stacstools.sentinel2 and are observing regular "hangs". Here are the logs from the process creating the STAC items for a bunch of scenes:
[INFO] 2023-08-15 21:55:48,346 - (000.06%) [0.78s] - blob://sentinel2l2a01/sentinel2-l2/36/S/VC/2023/05/08/S2B_MSIL2A_20230508T082609_N0509_R021_T36SVC_20230508T135506.SAFE/manifest.safe (1 of 1684)
[INFO] 2023-08-15 21:55:48,347 - Created item
[INFO] 2023-08-15 21:55:49,103 - (000.12%) [0.69s] - blob://sentinel2l2a01/sentinel2-l2/36/S/WB/2023/05/08/S2B_MSIL2A_20230508T082609_N0509_R021_T36SWB_20230508T133704.SAFE/manifest.safe (2 of 1684)
[INFO] 2023-08-15 21:55:49,103 - Created item
[INFO] 2023-08-15 22:00:50,805 - (000.18%) [301.67s] - blob://sentinel2l2a01/sentinel2-l2/36/S/XB/2023/05/08/S2B_MSIL2A_20230508T082609_N0509_R021_T36SXB_20230508T133650.SAFE/manifest.safe (3 of 1684)
[INFO] 2023-08-15 22:00:50,805 - Created item
[INFO] 2023-08-15 22:00:51,453 - (000.24%) [0.62s] - blob://sentinel2l2a01/sentinel2-l2/01/V/CC/2023/05/07/S2A_MSIL2A_20230507T231551_N0509_R087_T01VCC_20230508T070652.SAFE/manifest.safe (4 of 1684)
[INFO] 2023-08-15 22:00:51,453 - Created item
The ~300s item creation is suspiciously close to aiohttp's (the HTTP library used internally by fsspec) default 300s timeout plus the normal item creation time. I haven't been able to debug exactly what the issue is yet.
To reproduce
Something like occastionally reproduces it, but see below for caveats:
Unfortunately, I've only been able to reproduce it in an environment where the process running the command is in the same Azure region as the data (West Europe in this case). I haven't been able to reproduce it in an environment where I can actually inspect the process to see what's going on.
When it does hang, here's the traceback:
---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
Cell In[8], line 32
30print(line)
31 granule_href =f"[https://sentinel2l2a01.blob.core.windows.net/sentinel2-l2/{](https://sentinel2l2a01.blob.core.windows.net/sentinel2-l2/%7Bline)[line](https://sentinel2l2a01.blob.core.windows.net/sentinel2-l2/%7Bline)}"
---> 32 item: pystac.Item = stac.create_item(
33 granule_href=granule_href,
34 read_href_modifier=planetary_computer.sign,
35 antimeridian_strategy=Strategy.NORMALIZE,
36 coordinate_precision=7,
37 )
File /srv/conda/envs/notebook/lib/python3.11/site-packages/stactools/sentinel2/stac.py:57, in create_item(granule_href, additional_providers, read_href_modifier, antimeridian_strategy, coordinate_precision)
53 safe_manifest = SafeManifest(granule_href, read_href_modifier)
55 product_metadata = ProductMetadata(safe_manifest.product_metadata_href,
56 read_href_modifier)
---> 57 granule_metadata = GranuleMetadata(safe_manifest.granule_metadata_href,
58 read_href_modifier)
60 item = pystac.Item(
61id=product_metadata.scene_id,
62 geometry=product_metadata.geometry,
(...)
65 properties={},
66 )
68# --Common metadata--
File /srv/conda/envs/notebook/lib/python3.11/site-packages/stactools/sentinel2/granule_metadata.py:22, in GranuleMetadata.__init__(self, href, read_href_modifier)
17def__init__(self,
18 href,
19 read_href_modifier: Optional[ReadHrefModifier] =None):
20self.href = href
---> 22 self._root = XmlElement.from_file(href, read_href_modifier)
24 geocoding_node =self._root.find('n1:Geometric_Info/Tile_Geocoding')
25if geocoding_node isNone:
File /srv/conda/envs/notebook/lib/python3.11/site-packages/stactools/core/io/xml.py:74, in XmlElement.from_file(cls, href, read_href_modifier)
70@classmethod71deffrom_file(
72cls, href: str, read_href_modifier: Optional[ReadHrefModifier] =None73 ) ->"XmlElement":
---> 74 text = read_text(href, read_href_modifier)
75returncls(etree.fromstring(bytes(text, encoding="utf-8")))
File /srv/conda/envs/notebook/lib/python3.11/site-packages/stactools/core/io/__init__.py:20, in read_text(href, read_href_modifier)
18return StacIO.default().read_text(href)
19else:
---> 20 return StacIO.default().read_text(read_href_modifier(href))
File /srv/conda/envs/notebook/lib/python3.11/site-packages/pystac/stac_io.py:279, in DefaultStacIO.read_text(self, source, *_, **__)
274"""A concrete implementation of :meth:`StacIO.read_text275<pystac.StacIO.read_text>`. Converts the ``source`` argument to a string (if it276isnot already) and delegates to :meth:`DefaultStacIO.read_text_from_href`for277 opening and reading the file."""278 href =str(os.fspath(source))
--> 279 return self.read_text_from_href(href)
File /srv/conda/envs/notebook/lib/python3.11/site-packages/stactools/core/io/__init__.py:25, in FsspecStacIO.read_text_from_href(self, href, *args, **kwargs)
24defread_text_from_href(self, href: str, *args: Any, **kwargs: Any) -> str:
---> 25 with fsspec.open(href, "r") as f:
26 s = f.read()
27ifisinstance(s, str):
File /srv/conda/envs/notebook/lib/python3.11/site-packages/fsspec/core.py:102, in OpenFile.__enter__(self)
99def__enter__(self):
100 mode =self.mode.replace("t", "").replace("b", "") +"b"
--> 102 f = self.fs.open(self.path, mode=mode)
104self.fobjects = [f]
106ifself.compression isnotNone:
File /srv/conda/envs/notebook/lib/python3.11/site-packages/fsspec/spec.py:1241, in AbstractFileSystem.open(self, path, mode, block_size, cache_options, compression, **kwargs)
1239 else:
1240 ac = kwargs.pop("autocommit", not self._intrans)
-> 1241 f = self._open(
1242 path,
1243 mode=mode,
1244 block_size=block_size,
1245 autocommit=ac,
1246 cache_options=cache_options,
1247 **kwargs,
1248 )
1249 if compression is not None:
1250 from fsspec.compression import compr
File /srv/conda/envs/notebook/lib/python3.11/site-packages/fsspec/implementations/http.py:356, in HTTPFileSystem._open(self, path, mode, block_size, autocommit, cache_type, cache_options, size, **kwargs)
354 kw["asynchronous"] =self.asynchronous
355 kw.update(kwargs)
--> 356 size = size or self.info(path, **kwargs)["size"]
357 session = sync(self.loop, self.set_session)
358if block_size and size:
File /srv/conda/envs/notebook/lib/python3.11/site-packages/fsspec/asyn.py:121, in sync_wrapper.<locals>.wrapper(*args, **kwargs)
118@functools.wraps(func)
119defwrapper(*args, **kwargs):
120self= obj or args[0]
--> 121 return sync(self.loop, func, *args, **kwargs)
File /srv/conda/envs/notebook/lib/python3.11/site-packages/fsspec/asyn.py:94, in sync(loop, func, timeout, *args, **kwargs)
91 asyncio.run_coroutine_threadsafe(_runner(event, coro, result, timeout), loop)
92whileTrue:
93# this loops allows thread to get interrupted
---> 94 if event.wait(1):
95break96if timeout isnotNone:
File /srv/conda/envs/notebook/lib/python3.11/threading.py:622, in Event.wait(self, timeout)
620 signaled =self._flag
621ifnot signaled:
--> 622 signaled = self._cond.wait(timeout)
623return signaled
File /srv/conda/envs/notebook/lib/python3.11/threading.py:324, in Condition.wait(self, timeout)
322else:
323if timeout >0:
--> 324 gotit = waiter.acquire(True, timeout)
325else:
326 gotit = waiter.acquire(False)
KeyboardInterrupt:
Describe the bug
Dumping this less than complete bug report here. I'll try to fill in more details later.
We're using
FsspecStacIO
viastacstools.sentinel2
and are observing regular "hangs". Here are the logs from the process creating the STAC items for a bunch of scenes:The ~300s item creation is suspiciously close to aiohttp's (the HTTP library used internally by fsspec) default 300s timeout plus the normal item creation time. I haven't been able to debug exactly what the issue is yet.
To reproduce
Something like occastionally reproduces it, but see below for caveats:
Unfortunately, I've only been able to reproduce it in an environment where the process running the command is in the same Azure region as the data (West Europe in this case). I haven't been able to reproduce it in an environment where I can actually inspect the process to see what's going on.
When it does hang, here's the traceback:
Here are the versions of the relevant packages
** To workaround **
At least for our use case, we can disable the use of fsspec by running
after stactools.sentienl2 is imported. That workaround might help out others.
The text was updated successfully, but these errors were encountered: