docs: propose pipeline-scoped filter task supervisor - #7
Conversation
Filters have no lifecycle for work that must die with the pipeline, so overlay reload invented a private thread and azure_ad is copying it. Track the What/Why against praxis#1042. Signed-off-by: Aslak Knutsen <aslak@4fs.no>
bebb2f0 to
ed53664
Compare
|
I very much like the problem statement here. I'm wondering if a "tighter" lifecycle & matching callback couldn't also "help with that". Not to invalidate or rescope this tho, just food for thoughts. Also, most (all?) of the current use cases are effectively "refresh ahead caching use cases" - having a centralized location to coordinate across multiple refreshes might be desirable to avoid "thundering herd" problems, less on the SoR in this case, but rather in our client (e.g. serialize calls beyond |
|
I agree the cash refresh usecase specifically could be a good target as well and might build on a common foundation with tasks. I have a feeling a cache refresh would be tied to a Cache and somehow related to the Store. |
|
Thanks for writing this up matches what I've been sketching for #555/#810 on the credential-store side, and it's good to see we landed on the same process-vs-pipeline-lifetime boundary independently. Two things worth pinning down in the "How?" phase:
|
praxis-bot
left a comment
There was a problem hiding this comment.
PR Review
Summary: The proposal clearly motivates the need for pipeline-scoped background task supervision and correctly identifies the problem with the current thread-per-filter pattern. However, critical design questions about the API surface, failure modes, and task lifecycle are left too vague for stakeholders to assess feasibility even at the What/Why stage.
| Severity | Count |
|---|---|
| Large | 2 |
| Medium | 3 |
|
@szedan-rh on "Credential refresh" - I do think the tasks themselves should be tied to the pipeline. Now, I'm wondering whether the data stored by a filter shouldn't have a slight different lifecycle than the pipeline because of how we currently reload. If we'd know what data belongs to what filter ("statically owned"), we could GC data only when not needed after a reload, as the filter is gone. |
shaneutt
left a comment
There was a problem hiding this comment.
A couple of comments I would like to see resolved, and then LGTM for initial pass. I understand, and agree with what we want to do and why.
| - As a filter author, I want to start | ||
| pipeline-scoped background work without creating | ||
| a thread or runtime so that credential refresh | ||
| and file watch stay in-tree without copying | ||
| overlay internals. | ||
| - As a filter author, I want spawn failure to fail | ||
| pipeline build so that a dead refresher cannot | ||
| ship as a live 503-forever filter. | ||
| - As an operator, I want hot reload to stop the old | ||
| pipeline's background work so that refreshers and | ||
| watchers do not accumulate across config swaps. | ||
| - As a maintainer, I want one place that owns | ||
| filter background lifetime so that AI, core, and | ||
| extproc do not grow independent thread+runtime | ||
| copies. |
Co-authored-by: Shane Utt <shaneutt@linux.com> Signed-off-by: Aslak Knutsen <aslak.tux@gmail.com>
Co-authored-by: Shane Utt <shaneutt@linux.com> Signed-off-by: Aslak Knutsen <aslak.tux@gmail.com>
What does this PR do?
Filters have no lifecycle for work that must die with the pipeline, so overlay reload invented a private thread and azure_ad is copying it. Track the What/Why against praxis#1042.
Discussion link
Checklist