Repository navigation
fix: close all pipeline components even when an earlier close raises - #13845
TejasLamba2006 wants to merge 1 commit into
Conversation
|
@TejasLamba2006 is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||
|
Ran The same stop-at-first-error loop is still there one level down, in components that close other objects. I put an The loops are |
|
Thanks for running the suite against the branch. Keeping this PR strictly scoped to |
Related Issues
Proposed Changes:
PipelineBase.close()andPipelineBase.close_async()previously iterated overself.graph.nodeswithout isolating per-component errors. If an earlier component raised during cleanup (for example aLinkContentFetcherwhose keep-alive client belonged to a closed event loop), the loop exited immediately and skipped closing all remaining components in the pipeline.This PR wraps each component's
close()/close_async()call intry ... except Exception(leavingBaseExceptionsubclasses such asasyncio.CancelledErrorandKeyboardInterruptuntouched), logs a warning for each failure, continues closing the remaining components, and re-raises the first exception once all components have been attempted.How did you test it?
test/core/pipeline/test_pipeline_lifecycle.pycovering bothPipeline.close()andPipeline.close_async()(including async components, sync-fallback components, and multi-component failures).pytest test/core/pipeline/test_pipeline_lifecycle.py,ruff check,ruff format --check, andmypy.Notes for the reviewer
Only
Exceptioninstances are caught inside the loop so task cancellation (asyncio.CancelledError) still propagates immediately.Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:and added!in case the PR includes breaking changes.