Skip to content

Decouple FilterTreeCallbacks from TaskResourceTrackingService#1

Merged
himshikhagupta merged 1 commit into
himshikhagupta:analytics-delegation-task-trackingfrom
Bukhtawar:task-tracking-decouple-service
May 12, 2026
Merged

Decouple FilterTreeCallbacks from TaskResourceTrackingService#1
himshikhagupta merged 1 commit into
himshikhagupta:analytics-delegation-task-trackingfrom
Bukhtawar:task-tracking-decouple-service

Conversation

@Bukhtawar
Copy link
Copy Markdown

Introduce DelegationThreadTracker interface in the SPI layer so that FilterTreeCallbacks no longer depends on TaskResourceTrackingService directly. The tracker is created as a closure in AnalyticsSearchService where both the service and taskId are naturally available, keeping the FFM callback layer free of core OpenSearch dependencies.

Also fixes premature tracker cleanup in the streaming path by tying the tracker lifecycle to FragmentResources.close() instead of a finally block that fires before the stream is consumed.

Description

[Describe what this change achieves]

Related Issues

Resolves opensearch-project#21610

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Introduce DelegationThreadTracker interface in the SPI layer so that
FilterTreeCallbacks no longer depends on TaskResourceTrackingService
directly. The tracker is created as a closure in AnalyticsSearchService
where both the service and taskId are naturally available, keeping the
FFM callback layer free of core OpenSearch dependencies.

Also fixes premature tracker cleanup in the streaming path by tying
the tracker lifecycle to FragmentResources.close() instead of a
finally block that fires before the stream is consumed.

Signed-off-by: Bukhtawar Khan <bukhtawa@amazon.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Bukhtawar Khan <bukhtawa@amazon.com>
@himshikhagupta himshikhagupta merged commit 8d2a60c into himshikhagupta:analytics-delegation-task-tracking May 12, 2026
10 checks passed
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.

2 participants