fix(so): catalogo SDMX con detail=allstubs e timeout radar dedicato - #414
Merged
Conversation
Il catalogo SDMX completo (es. dataflow/IT1) serializza migliaia di dataflow in una risposta unica (~60-80s anche in modalita' ridotta). Con il timeout radar di 10s ISTAT era sempre YELLOW (ReadTimeout) e l'inventory scaricava il payload full, vicino al limite dei 330s. - collectors/sdmx.py: catalog_fetch_url() aggiunge ?detail=allstubs alla fetch del catalogo (payload ridotto a id+nome, sufficiente per l'inventory) - radar_check.py: SDMX_TIMEOUT_SECONDS=180 + ramo SDMX in probe_url() (allstubs + timeout dedicato); non-SDMX invariato - test: 4 test catalog_fetch_url, 1 test ramo SDMX radar, chiavi fake allineate
Gabrymi93
force-pushed
the
fix/istat-sdmx-allstubs-timeout
branch
from
August 2, 2026 17:32
f4f1472 to
875d256
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sintesi
Il catalogo SDMX completo di ISTAT (
dataflow/IT1) serializza ~4.900 dataflow in una risposta unica (~60-80s anche in modalità ridotta). Questo causava due problemi:TIMEOUT_SECONDS = 10→ ReadTimeout garantito →istat_sdmxsempre YELLOWFix: fetch del catalogo con
detail=allstubs(payload ridotto a id+nome, che è tutto ciò che l'inventory usa) + timeout radar dedicato per SDMX.Contesto collegato
Nessuna issue collegata — fix nato da esplorazione tecnica (guida ondata/guida-api-istat): la risposta
allstubsè verificata compatibile (id, agencyID, Name presenti).Cosa cambia
Checklist
Se modifichi script o MCP
pytest tests/passa (29 sui file toccati; 66+2 sui moduli consumatori)ruff check .passamypy scripts/ so_mcp/passa (verificato su file toccati)Verifica
Run reali contro il servizio ISTAT, non fake:
probe_url('https://esploradati.istat.it/SDMXWS/rest/dataflow/IT1')→ GREEN / HTTP 200 in 58s (prima: YELLOW ReadTimeout)scripts.radar_check):istat_sdmx→ GREEN, http_code 200, note null (era YELLOWReadTimeout)build_catalog_inventory --workers 16 --skip-red-sources):istat_sdmx→ status ok, rows 4899, method dataflow_count;api_base_urlpulita (0 URL contaminati daallstubs),distribution_urlcorrettaTest aggiunti: 4 test
catalog_fetch_url(URL vuota / senza query / con query / detail già presente), 1 test ramo SDMX inprobe_url(verifica timeout 180s e URL con allstubs).Note per chi revisiona
base_urldel registry intatta, stessi item, stesso schema output. Unica fonte SDMX nel registry èistat_sdmx, quindi impatto circoscritto.catalog_fetch_url()non forza il parametro sedetail=è già presente nell'URL (comportamento conservativo)..gitignore): verranno rigenerati dalla CI post-merge, come da pratica esistente.format=csvnelladistribution_urlSDMX non è supportato da ISTAT (serve headerAccept); eventuale fix separato.