Skip to content

fix: route telemetry HTTP through shared connection stack; fix close() flush race#362

Merged
samikshya-db merged 2 commits intomainfrom
telemetry-2-vikrant-fixes
Apr 21, 2026
Merged

fix: route telemetry HTTP through shared connection stack; fix close() flush race#362
samikshya-db merged 2 commits intomainfrom
telemetry-2-vikrant-fixes

Conversation

@samikshya-db
Copy link
Copy Markdown
Collaborator

Summary

Targeted fixes addressing Vikrant's Apr 21 review comments on #325.

  • Shared HTTP stack (DatabricksTelemetryExporter, FeatureFlagCache): sendRequest and fetchWithRetry now use connectionProvider.getRetryPolicy().invokeWithRetry(), matching the CloudFetchResultHandler pattern. Removes bespoke per-file fetch/retry logic.
  • MetricsAggregator.close() flush race: adds a closing flag so batch-triggered fire-and-forget flushes are suppressed during the close loop, ensuring flushForClose() is the single awaited drain with no escaping promises.

Test plan

  • 215 unit tests pass
  • 3-file diff only — no unrelated changes

This pull request was AI-assisted by Isaac.

…) flush race

- DatabricksTelemetryExporter.sendRequest and FeatureFlagCache.fetchWithRetry
  now use connectionProvider.getRetryPolicy().invokeWithRetry(), matching the
  CloudFetchResultHandler pattern instead of bespoke fetch/retry logic
- MetricsAggregator: add closing flag so batch-triggered fire-and-forget flushes
  are suppressed during close(), ensuring a single awaited flushForClose() drains
  all remaining metrics without racing past process.exit()

Co-authored-by: samikshya-chand_data
@github-actions
Copy link
Copy Markdown

Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase (git rebase -i main).

Replace completeStatementForClose/flushForClose toggle pattern with a
closing flag that suppresses batch-triggered fire-and-forget flushes.
Set closing=true first so completeStatement works normally via
addPendingMetric (closed is still false), then seal with closed=true
and drain with a single awaited flush(false).

Co-authored-by: samikshya-chand_data
@github-actions
Copy link
Copy Markdown

Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase (git rebase -i main).

@samikshya-db samikshya-db merged commit 3a5e659 into main Apr 21, 2026
7 of 8 checks passed
@samikshya-db samikshya-db deleted the telemetry-2-vikrant-fixes branch April 21, 2026 08:51
samikshya-db added a commit that referenced this pull request Apr 21, 2026
…e, MetricsAggregator

Picks up #362 (shared connection stack + close() flush race fix) merged to main.
Resolves add/add conflicts by preferring main's versions of the three infrastructure
files, consistent with the prior merge strategy.

Co-authored-by: samikshya-chand_data
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