Files
galaxy/test
mvdbeek 90cff585a4 Handle MaxDiscoveredFilesExceededError gracefully for dynamic collections
Tools whose only discoverable outputs are dynamic collections (no primary
assign_primary_output dataset) were raising MaxDiscoveredFilesExceededError
from inside collect_dynamic_outputs, where a blanket `except Exception`
swallowed it via `log.exception`, shipping a traceback to Sentry and
leaving the outer handlers in set_metadata_portable / MinimalJobWrapper
without the error to record in job_messages.

Catch MaxDiscoveredFilesExceededError in collect_dynamic_outputs, mark the
collection as population-failed, register it with the job context so the
FAILED state is serialized through the extended-metadata export store, and
re-raise so the outer handlers can record a max_discovered_files entry in
job_messages. Log at warning level instead of error in the outer handlers.

In set_metadata_portable the pre-_finalize export_job was redundant
(immediately overwritten by _finalize) so drop it; add a single
post-_finalize export_job in the error path because _finalize cannot find
the job through included_datasets / included_collections when discovery
failed before anything was added to them.

Fixes #22394
2026-04-07 11:23:23 +02:00
..
2026-01-20 10:25:45 +00:00
2025-10-29 18:45:26 +00:00