Skip to content

Fix DAG processor detecting non-zip archives as DAG bundles - #71686

Open
pulaksaha143 wants to merge 1 commit into
apache:mainfrom
pulaksaha143:fix-dag-processor-zip-bundle-71125
Open

Fix DAG processor detecting non-zip archives as DAG bundles#71686
pulaksaha143 wants to merge 1 commit into
apache:mainfrom
pulaksaha143:fix-dag-processor-zip-bundle-71125

Conversation

@pulaksaha143

Copy link
Copy Markdown

Fixes #71125

Description

Previously, find_dag_file_paths used zipfile.is_zipfile() to sniff if a file could be a DAG bundle. Since the PK-ZIP format underpins many common file types (such as .jar, .docx, .pptx, .xlsx), the DAG processor would waste time opening and scanning these irrelevant files if they were placed in the DAGs folder.

This update enforces that a file must end in .zip before it is considered a DAG bundle, eliminating wasted CPU cycles and log noise for deployments that store supporting zip-format files alongside their DAGs.

Testing

  • Added test_find_dag_file_paths_ignores_non_zip_archives in test_file.py which mocks the presence of .jar and .docx files, ensuring they are ignored.

Fixes apache#71125

Previously, `find_dag_file_paths` used `zipfile.is_zipfile()` to sniff if a file
could be a DAG bundle. Since the PK-ZIP format underpins many common file types
(such as `.jar`, `.docx`, `.pptx`, `.xlsx`), the DAG processor would waste time
opening and scanning these irrelevant files if they were placed in the DAGs folder.

This update enforces that a file must end in `.zip` before it is considered a
DAG bundle, eliminating wasted CPU cycles and log noise for deployments that
store supporting zip-format files alongside their DAGs.
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

Successfully merging this pull request may close these issues.

DAG processor treats any zip-format file (.jar, .pptx, .docx, .xlsx, etc.) as a potential DAG bundle, not just .zip

1 participant