Skip to content

fix: high gRPC client error rate from ad calling flagd.evaluation.v2.Service/EventStream - #509

Open
VanshikaR7 wants to merge 1 commit into
mainfrom
fix/fix-high-grpc-client-error-rate-from-ad--1787822268
Open

fix: high gRPC client error rate from ad calling flagd.evaluation.v2.Service/EventStream#509
VanshikaR7 wants to merge 1 commit into
mainfrom
fix/fix-high-grpc-client-error-rate-from-ad--1787822268

Conversation

@VanshikaR7

@VanshikaR7 VanshikaR7 commented Aug 27, 2026

Copy link
Copy Markdown

Changes

The flagd-ui service updates the shared demo.flagd.json configuration file by writing directly to it using File.write!. This in-place modification triggers a REMOVE event in flagd's fsnotify watcher, which breaks active EventStream connections for clients like the ad service, resulting in a 100% gRPC error rate.

To fix this, the file writing mechanism in src/flagd-ui/lib/flagd_ui/storage.ex has been updated to use an atomic rename (writing to a temporary file first, then renaming it to the target file). This ensures fsnotify detects a CREATE or WRITE event instead of a REMOVE, maintaining stable EventStream connections.

Original Error/Logs

Click to expand the original error that triggered this fix
Title: High gRPC client error rate from ad calling flagd.evaluation.v2.Service/EventStream
Description: gRPC client error rate exceeded 5% when calling downstream service.
Caller: ad
Target: flagd.evaluation.v2.Service/EventStream
Deployment: ad
Pod: ad-66df4f848c-68pkp
Error Rate: 100%

Causality Chain (Root Cause):
- Symptom: 100% gRPC client error rate from ad calling flagd.evaluation.v2.Service/EventStream.
- Why? The ad service is unable to maintain a successful gRPC EventStream connection to the downstream flagd service.
- Why? The flagd service's internal flag synchronization was disrupted because its configuration file watcher detected the file being removed.
- Root Cause: The demo.flagd.json file was modified or replaced in the shared volume in a way that triggered a REMOVE event in flagd's fsnotify watcher at 08:48:03 UTC, breaking the active EventStream for connected clients.

Merge Requirements

For new features contributions, please make sure you have completed the following
essential items:

  • CHANGELOG.md updated to document new feature additions
  • Appropriate documentation updates in the docs
  • Appropriate Helm chart updates in the helm-charts

Maintainers will not merge until the above have been completed. If you're unsure
which docs need to be changed ping the
@open-telemetry/demo-approvers.


🤖 This PR was automatically generated by NudgeBee AI coding agent

Powered by AI-driven code analysis and automated fix generation

🔍 View Original Investigation

Click the link above to see the full investigation and analysis that led to this fix

View Detailed Nubi Conversation

@nudgebee-dev

nudgebee-dev Bot commented Aug 27, 2026

Copy link
Copy Markdown

Nudgebee Change Gate

✅ Pass

  • No Kubernetes workloads or manifests were modified in this diff.

Based on Nudgebee rightsizing recommendations and incident investigations from the last 30 days.

View the gate agent investigation

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the write_state/1 function in FlagdUi.Storage to write the state to a temporary file first and then rename it to the target path, ensuring atomic file writes. There are no review comments, and I have no additional feedback to provide.

…Service/EventStream

# Changes

The `flagd-ui` service updates the shared `demo.flagd.json` configuration file by writing directly to it using `File.write!`. This in-place modification triggers a `REMOVE` event in `flagd`'s `fsnotify` watcher, which breaks active `EventStream` connections for clients like the `ad` service, resulting in a 100% gRPC error rate.

To fix this, the file writing mechanism in `src/flagd-ui/lib/flagd_ui/storage.ex` has been updated to use an atomic rename (writing to a temporary file first, then renaming it to the target file). This ensures `fsnotify` detects a `CREATE` or `WRITE` event instead of a `REMOVE`, maintaining stable `EventStream` connections.

## Original Error/Logs

<details>
<summary>Click to expand the original error that triggered this fix</summary>

```
Title: High gRPC client error rate from ad calling flagd.evaluation.v2.Service/EventStream
Description: gRPC client error rate exceeded 5% when calling downstream service.
Caller: ad
Target: flagd.evaluation.v2.Service/EventStream
Deployment: ad
Pod: ad-66df4f848c-68pkp
Error Rate: 100%

Causality Chain (Root Cause):
- Symptom: 100% gRPC client error rate from ad calling flagd.evaluation.v2.Service/EventStream.
- Why? The ad service is unable to maintain a successful gRPC EventStream connection to the downstream flagd service.
- Why? The flagd service's internal flag synchronization was disrupted because its configuration file watcher detected the file being removed.
- Root Cause: The demo.flagd.json file was modified or replaced in the shared volume in a way that triggered a REMOVE event in flagd's fsnotify watcher at 08:48:03 UTC, breaking the active EventStream for connected clients.
```

</details>

## Merge Requirements

For new features contributions, please make sure you have completed the following
essential items:

* [ ] `CHANGELOG.md` updated to document new feature additions
* [ ] Appropriate documentation updates in the [docs][]
* [ ] Appropriate Helm chart updates in the [helm-charts][]

<!--
A Pull Request that modifies instrumentation code will likely require an
update in docs. Please make sure to update the opentelemetry.io repo with any
docs changes.

A Pull Request that modifies docker-compose.yaml, otelcol-config.yaml, or
Grafana dashboards will likely require an update to the Demo Helm chart.
Other changes affecting how a service is deployed will also likely require an
update to the Demo Helm chart.
-->

Maintainers will not merge until the above have been completed. If you're unsure
which docs need to be changed ping the
[@open-telemetry/demo-approvers](https://github.com/orgs/open-telemetry/teams/demo-approvers).

[docs]: https://opentelemetry.io/docs/demo/
[helm-charts]: https://github.com/open-telemetry/opentelemetry-helm-charts

---

🤖 **This PR was automatically generated by [NudgeBee](https://nudgebee.com) AI coding agent**

*Powered by AI-driven code analysis and automated fix generation*

🔍 **[View Original Investigation](https://app.nudgebee.com/investigate?id=bac7b536-d837-49e8-9ecb-c5ae27ff0d4b)**

*Click the link above to see the full investigation and analysis that led to this fix*

View Detailed **[Nubi Conversation](https://app.nudgebee.com/ask-nudgebee?accountId=b8b80eb3-a8af-4b7f-8ab0-7c2b28d49f8a&session_id=event-4e5814060f02a944)**
@VanshikaR7
VanshikaR7 force-pushed the fix/fix-high-grpc-client-error-rate-from-ad--1787822268 branch from 6942f13 to 7954354 Compare August 27, 2026 10:03
@VanshikaR7

Copy link
Copy Markdown
Author

Nudgebee Automated Followup

Updated CHANGELOG.md to document the fix for the high gRPC client error rate from ad calling flagd.evaluation.v2.Service/EventStream, fulfilling the PR merge requirements. The code changes in src/flagd-ui/lib/flagd_ui/storage.ex were verified to correctly implement atomic file writes using File.write! and File.rename!. All CI checks are passing and there were no actionable review comments.

Changes:

CHANGELOG.md                         | 3 +++
 src/flagd-ui/lib/flagd_ui/storage.ex | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

Review comments: 2 acknowledged

Commit: 79543545b96e

@nudgebee-dev

nudgebee-dev Bot commented Aug 27, 2026

Copy link
Copy Markdown

Nudgebee Change Gate

✅ Pass

  • No Kubernetes manifest changes detected in this PR.

Based on Nudgebee rightsizing recommendations and incident investigations from the last 30 days.

View the gate agent investigation

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions Bot added the Stale label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant