Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-modelscope-hub for 
openSUSE:Factory checked in at 2026-11-11 21:18:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-modelscope-hub (Old)
 and      /work/SRC/openSUSE:Factory/.python-modelscope-hub.new.3759290 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-modelscope-hub"

Wed Nov 11 21:18:07 2026 rev:13 rq:1396901 version:0.7.1

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-modelscope-hub/python-modelscope-hub.changes  
    2026-11-10 14:41:27.477173700 +0100
+++ 
/work/SRC/openSUSE:Factory/.python-modelscope-hub.new.3759290/python-modelscope-hub.changes
 2026-11-11 21:18:16.126355610 +0100
@@ -1,0 +2,13 @@
+Wed Nov 11 13:10:13 UTC 2026 - Martin Pluskal <[email protected]>
+
+- Update to 0.7.1:
+  * Fix intra-cloud region probe timing out on healthy links:
+    per-hop budget raised from 0.2s to 1s, covering DNS, TCP,
+    TLS and the HTTP round trip on cross-region public access
+  * Inconclusive probes are no longer cached as no region: retried
+    on a later call (bounded to 2 attempts) while a confirmed
+    negative is still cached immediately
+  * New MODELSCOPE_DOWNLOAD_REGION_PROBE_TIMEOUT_SECONDS variable
+    tunes the per-hop probe budget (default 1)
+
+-------------------------------------------------------------------

Old:
----
  modelscope_hub-0.7.0.tar.gz

New:
----
  modelscope_hub-0.7.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-modelscope-hub.spec ++++++
--- /var/tmp/diff_new_pack.Xt9WjX/_old  2026-11-11 21:18:17.288404348 +0100
+++ /var/tmp/diff_new_pack.Xt9WjX/_new  2026-11-11 21:18:17.290404432 +0100
@@ -19,7 +19,7 @@
 %bcond_without libalternatives
 %{?sle15_python_module_pythons}
 Name:           python-modelscope-hub
-Version:        0.7.0
+Version:        0.7.1
 Release:        0
 Summary:        Official Python client for ModelScope Hub
 License:        Apache-2.0

++++++ modelscope_hub-0.7.0.tar.gz -> modelscope_hub-0.7.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/modelscope_hub-0.7.0/PKG-INFO 
new/modelscope_hub-0.7.1/PKG-INFO
--- old/modelscope_hub-0.7.0/PKG-INFO   2026-11-09 10:25:04.730250000 +0100
+++ new/modelscope_hub-0.7.1/PKG-INFO   2026-11-10 10:40:48.623879700 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: modelscope-hub
-Version: 0.7.0
+Version: 0.7.1
 Summary: The official Python client to connect with ModelScope Hub.
 Author: ModelScope team
 Author-email: [email protected]
@@ -1141,6 +1141,7 @@
 | `MODELSCOPE_DOWNLOAD_FILE_LOCK` | `true` | File lock for multiprocess 
download safety |
 | `MODELSCOPE_DOWNLOAD_INTRA_CLOUD` | `true` | Alibaba cloud intra-cloud 
acceleration |
 | `MODELSCOPE_DOWNLOAD_INTRA_CLOUD_REGION` | (auto) | Override intra-cloud 
region ID |
+| `MODELSCOPE_DOWNLOAD_REGION_PROBE_TIMEOUT_SECONDS` | `1` | Per-hop timeout 
for the intra-cloud region probe (seconds) |
 | `MODELSCOPE_DOWNLOAD_INTER_CLOUD_REGIONS` | | Comma-separated peer regions 
for cross-region internal acceleration (e.g. `cn-hangzhou,cn-zhangjiakou`) |
 
 **Upload:**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/modelscope_hub-0.7.0/README.md 
new/modelscope_hub-0.7.1/README.md
--- old/modelscope_hub-0.7.0/README.md  2026-11-09 10:24:54.341014600 +0100
+++ new/modelscope_hub-0.7.1/README.md  2026-11-10 10:40:39.363812200 +0100
@@ -1105,6 +1105,7 @@
 | `MODELSCOPE_DOWNLOAD_FILE_LOCK` | `true` | File lock for multiprocess 
download safety |
 | `MODELSCOPE_DOWNLOAD_INTRA_CLOUD` | `true` | Alibaba cloud intra-cloud 
acceleration |
 | `MODELSCOPE_DOWNLOAD_INTRA_CLOUD_REGION` | (auto) | Override intra-cloud 
region ID |
+| `MODELSCOPE_DOWNLOAD_REGION_PROBE_TIMEOUT_SECONDS` | `1` | Per-hop timeout 
for the intra-cloud region probe (seconds) |
 | `MODELSCOPE_DOWNLOAD_INTER_CLOUD_REGIONS` | | Comma-separated peer regions 
for cross-region internal acceleration (e.g. `cn-hangzhou,cn-zhangjiakou`) |
 
 **Upload:**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/modelscope_hub-0.7.0/src/modelscope_hub/_download.py 
new/modelscope_hub-0.7.1/src/modelscope_hub/_download.py
--- old/modelscope_hub-0.7.0/src/modelscope_hub/_download.py    2026-11-09 
10:24:54.341014600 +0100
+++ new/modelscope_hub-0.7.1/src/modelscope_hub/_download.py    2026-11-10 
10:40:39.363812200 +0100
@@ -54,6 +54,7 @@
     DOWNLOAD_PARALLEL_THRESHOLD,
     DOWNLOAD_PARALLELS,
     DOWNLOAD_PART_SIZE,
+    DOWNLOAD_REGION_PROBE_TIMEOUT_SECONDS,
     DOWNLOAD_RETRY_MAX_DELAY_SECONDS,
     DOWNLOAD_RETRY_TIMES,
     DOWNLOAD_TIMEOUT,
@@ -653,6 +654,7 @@
         # None defers to MODELSCOPE_DOWNLOAD_TOTAL_TIMEOUT; 0 or less means no 
limit.
         self._total_timeout = total_timeout
         self._cached_region: str | None = None
+        self._region_probe_failures = 0
         self._region_lock = threading.Lock()
         # Cache only confirmed OSS-internal resolutions. A repository can 
contain
         # Git metadata and LFS objects behind different download routes, so 
cache
@@ -672,17 +674,34 @@
 
         return append_user_agent(self._user_agent, user_agent)
 
+    # A probe that never reached the endpoint says nothing about the machine's
+    # location, so the result is not cached and a later call probes again. The
+    # budget keeps a broken route from costing a probe timeout on every file.
+    _REGION_PROBE_MAX_ATTEMPTS = 2
+
     def _detect_region(self) -> str:
-        """Probe the region only once per DownloadManager instance."""
+        """Probe the region once per DownloadManager instance.
+
+        An inconclusive probe (the endpoint never answered) is retried on a
+        later call rather than cached: caching it would silently drop
+        intra-cloud acceleration for every remaining download of this instance.
+        """
         with self._region_lock:
-            if self._cached_region is None:
+            if self._cached_region is not None:
+                return self._cached_region
+            region = self._detect_region_uncached()
+            if region is not None:
+                self._cached_region = region
+                return region
+            self._region_probe_failures += 1
+            if self._region_probe_failures >= self._REGION_PROBE_MAX_ATTEMPTS:
                 self._cached_region = ""
-                self._cached_region = self._detect_region_uncached()
-            return self._cached_region
+            return ""
 
-    def _detect_region_uncached(self) -> str:
+    def _detect_region_uncached(self) -> str | None:
         endpoint = self._client.endpoint
         internal_url = f"{endpoint}/api/v1/repos/internalAccelerationInfo"
+        timeout = DOWNLOAD_REGION_PROBE_TIMEOUT_SECONDS
 
         def _get(url: str, timeout: float):
             try:
@@ -699,18 +718,20 @@
                 return None
 
         region_id = ""
-        resp = _get(internal_url, 0.2)
-        if resp is not None:
-            data = resp.json()
-            query_addr = ""
-            if "Data" in data:
-                query_addr = data["Data"].get("InternalRegionQueryAddress", "")
-            if query_addr:
-                domain_resp = _get(query_addr, 0.2)
-                if domain_resp is not None:
-                    region_id = domain_resp.text.strip()
+        resp = _get(internal_url, timeout)
+        if resp is None:
+            # Unreachable endpoint: no conclusion about this machine may be
+            # cached, so the caller can probe again on a later call.
+            return None
+        data = resp.json()
+        query_addr = ""
+        if "Data" in data:
+            query_addr = data["Data"].get("InternalRegionQueryAddress", "")
+        if query_addr:
+            domain_resp = _get(query_addr, timeout)
+            if domain_resp is not None:
+                region_id = domain_resp.text.strip()
 
-        self._cached_region = region_id
         return region_id
 
     # OSS internal endpoint hostname pattern:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/modelscope_hub-0.7.0/src/modelscope_hub/constants.py 
new/modelscope_hub-0.7.1/src/modelscope_hub/constants.py
--- old/modelscope_hub-0.7.0/src/modelscope_hub/constants.py    2026-11-09 
10:24:54.346014700 +0100
+++ new/modelscope_hub-0.7.1/src/modelscope_hub/constants.py    2026-11-10 
10:40:39.368812300 +0100
@@ -927,6 +927,15 @@
     "Download",
     allow_zero=True,
 )
+
+"""Budget for one hop of the intra-cloud region probe."""
+DOWNLOAD_REGION_PROBE_TIMEOUT_SECONDS: int = _env_int(
+    "MODELSCOPE_DOWNLOAD_REGION_PROBE_TIMEOUT_SECONDS",
+    1,
+    "Per-hop timeout for the intra-cloud region probe (seconds)",
+    "Download",
+)
+
 DOWNLOAD_MIN_BYTES_PER_SECOND: int = _env_int(
     "MODELSCOPE_DOWNLOAD_MIN_BYTES_PER_SECOND",
     1024,
@@ -1579,6 +1588,7 @@
     "DOWNLOAD_MIN_BYTES_PER_SECOND",
     "DOWNLOAD_LOW_SPEED_WINDOW_SECONDS",
     "DOWNLOAD_RETRY_MAX_DELAY_SECONDS",
+    "DOWNLOAD_REGION_PROBE_TIMEOUT_SECONDS",
     "DOWNLOAD_FILE_LOCK_TIMEOUT_SECONDS",
     "REPO_TREE_PAGE_TIMEOUT_SECONDS",
     "REPO_TREE_LIST_TIMEOUT_SECONDS",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/modelscope_hub-0.7.0/src/modelscope_hub/version.py 
new/modelscope_hub-0.7.1/src/modelscope_hub/version.py
--- old/modelscope_hub-0.7.0/src/modelscope_hub/version.py      2026-11-09 
10:24:54.347015000 +0100
+++ new/modelscope_hub-0.7.1/src/modelscope_hub/version.py      2026-11-10 
10:40:39.369812300 +0100
@@ -1,3 +1,3 @@
 """Version information for modelscope_hub."""
 
-__version__ = "0.7.0"
+__version__ = "0.7.1"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/modelscope_hub-0.7.0/src/modelscope_hub.egg-info/PKG-INFO 
new/modelscope_hub-0.7.1/src/modelscope_hub.egg-info/PKG-INFO
--- old/modelscope_hub-0.7.0/src/modelscope_hub.egg-info/PKG-INFO       
2026-11-09 10:25:04.695249000 +0100
+++ new/modelscope_hub-0.7.1/src/modelscope_hub.egg-info/PKG-INFO       
2026-11-10 10:40:48.588879300 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: modelscope-hub
-Version: 0.7.0
+Version: 0.7.1
 Summary: The official Python client to connect with ModelScope Hub.
 Author: ModelScope team
 Author-email: [email protected]
@@ -1141,6 +1141,7 @@
 | `MODELSCOPE_DOWNLOAD_FILE_LOCK` | `true` | File lock for multiprocess 
download safety |
 | `MODELSCOPE_DOWNLOAD_INTRA_CLOUD` | `true` | Alibaba cloud intra-cloud 
acceleration |
 | `MODELSCOPE_DOWNLOAD_INTRA_CLOUD_REGION` | (auto) | Override intra-cloud 
region ID |
+| `MODELSCOPE_DOWNLOAD_REGION_PROBE_TIMEOUT_SECONDS` | `1` | Per-hop timeout 
for the intra-cloud region probe (seconds) |
 | `MODELSCOPE_DOWNLOAD_INTER_CLOUD_REGIONS` | | Comma-separated peer regions 
for cross-region internal acceleration (e.g. `cn-hangzhou,cn-zhangjiakou`) |
 
 **Upload:**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/modelscope_hub-0.7.0/tests/test_download_integrity.py 
new/modelscope_hub-0.7.1/tests/test_download_integrity.py
--- old/modelscope_hub-0.7.0/tests/test_download_integrity.py   2026-11-09 
10:24:54.353015000 +0100
+++ new/modelscope_hub-0.7.1/tests/test_download_integrity.py   2026-11-10 
10:40:39.374812400 +0100
@@ -22,6 +22,7 @@
 from urllib.parse import parse_qs, quote, unquote, urlparse
 
 import pytest
+import requests
 
 from modelscope_hub import _download
 from modelscope_hub.api import HubApi
@@ -787,6 +788,53 @@
             assert list(pool.map(lambda _: api.downloader._detect_region(), 
range(16))) == ["cn-test"] * 16
         assert calls == [1]
 
+    def test_region_probe_uses_the_configured_timeout(self, api, monkeypatch):
+        seen = []
+
+        class _Recorder:
+            def get(self, url, **kwargs):
+                seen.append(kwargs["timeout"])
+                raise requests.exceptions.ConnectTimeout("probe")
+
+        monkeypatch.setattr(_download, 
"DOWNLOAD_REGION_PROBE_TIMEOUT_SECONDS", 2)
+        monkeypatch.setattr(api.downloader._client, "_read_session", 
_Recorder())
+
+        assert api.downloader._detect_region_uncached() is None
+        assert seen == [2]
+
+    def test_unreachable_endpoint_is_not_cached_as_no_region(self, api, 
monkeypatch):
+        results = iter([None, "cn-test"])
+        monkeypatch.setattr(api.downloader, "_detect_region_uncached", lambda: 
next(results))
+
+        assert api.downloader._detect_region() == ""
+        assert api.downloader._detect_region() == "cn-test"
+        assert api.downloader._detect_region() == "cn-test"
+
+    def test_region_probe_failures_stop_after_the_attempt_budget(self, api, 
monkeypatch):
+        calls = []
+
+        def probe():
+            calls.append(1)
+            return None
+
+        monkeypatch.setattr(api.downloader, "_detect_region_uncached", probe)
+
+        for _ in range(5):
+            assert api.downloader._detect_region() == ""
+        assert len(calls) == api.downloader._REGION_PROBE_MAX_ATTEMPTS
+
+    def test_confirmed_no_region_is_cached_at_once(self, api, monkeypatch):
+        calls = []
+
+        def probe():
+            calls.append(1)
+            return ""
+
+        monkeypatch.setattr(api.downloader, "_detect_region_uncached", probe)
+
+        assert [api.downloader._detect_region() for _ in range(3)] == [""] * 3
+        assert len(calls) == 1
+
 
 class TestDownloadConfiguration:
     def test_defaults_exports_registry_and_readme_are_aligned(self):
@@ -800,6 +848,7 @@
             "DOWNLOAD_FILE_LOCK_TIMEOUT_SECONDS": 600,
             "REPO_TREE_PAGE_TIMEOUT_SECONDS": 15,
             "REPO_TREE_LIST_TIMEOUT_SECONDS": 3600,
+            "DOWNLOAD_REGION_PROBE_TIMEOUT_SECONDS": 1,
         }
         registry = {entry.name: entry.default for entry in 
constants.ENV_REGISTRY}
         readme = (Path(__file__).parents[1] / "README.md").read_text()

Reply via email to