Skip to content

fix(rag): honor ctx cancellation in Initialize/Query fan-in collectors #3597

Description

@aheritier

Summary

pkg/rag/manager.go:219-225 (Initialize) and :352-360 (Query) receive from resultsChan without selecting on ctx.Done(); a strategy that hangs (ignoring ctx) blocks the caller forever. Buffered channels already prevent goroutine leaks; only the caller hang remains.

Fix

select on ctx.Done() in both collect loops.

Acceptance

  • A hanging strategy no longer blocks the caller past ctx cancellation; test.

Metadata

Metadata

Assignees

Labels

area/ragFor work/issues that have to do with the RAG featureskind/fixPR fixes a bug (maps to fix:). Use on PRs only.

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions