Skip to content

Conversation

@avara1986
Copy link
Member

@avara1986 avara1986 commented Jun 8, 2023

When Remote Configuration (RC) receives new configurations, the RC Client has two kinds of actions: removing target file configurations and loading new target file configurations.

The problem arises when we receive both kinds of actions simultaneously, as the load action overrides the remove action. This error occurs if someone creates and removes Dynamic Instrumentation Probes rapidly, within a time interval shorter than the Remote Config interval (5s).

To fix this issue, we append all new configurations and configurations to remove, and dispatch them at the end of the RC request.

Checklist

  • Change(s) are motivated and described in the PR description.
  • Testing strategy is described if automated tests are not included in the PR.
  • Risk is outlined (performance impact, potential for breakage, maintainability, etc).
  • Change is maintainable (easy to change, telemetry, documentation).
  • Library release note guidelines are followed.
  • Documentation is included (in-code, generated user docs, public corp docs).

Reviewer Checklist

  • Title is accurate.
  • No unnecessary changes are introduced.
  • Description motivates each change.
  • Avoids breaking API changes unless absolutely necessary.
  • Testing strategy adequately addresses listed risk(s).
  • Change is maintainable (easy to change, telemetry, documentation).
  • Release note makes sense to a user of the library.
  • Reviewer has explicitly acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment.

@avara1986 avara1986 added changelog/no-changelog A changelog entry is not required for this PR. ASM Application Security Monitoring labels Jun 8, 2023
@avara1986 avara1986 marked this pull request as ready for review June 8, 2023 13:28
@avara1986 avara1986 requested review from a team as code owners June 8, 2023 13:28
@avara1986 avara1986 changed the title fix(rcm): Remote config ayloads are override fix(rcm): remote config payloads are override Jun 8, 2023
@avara1986 avara1986 changed the title fix(rcm): remote config payloads are override fix(rcm): remote config payloads error Jun 8, 2023
@avara1986 avara1986 requested a review from a team as a code owner June 8, 2023 14:29
@avara1986 avara1986 removed the changelog/no-changelog A changelog entry is not required for this PR. label Jun 8, 2023
@pr-commenter
Copy link

pr-commenter bot commented Jun 9, 2023

Benchmarks

Comparing candidate commit e2372a9 in PR branch avara1986/APPSEC-9946-rc-error-overriding-payloads with baseline commit ba3a1f4 in branch 1.x.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 90 cases.

@avara1986 avara1986 enabled auto-merge (squash) June 12, 2023 14:13
@avara1986 avara1986 merged commit b1000fd into 1.x Jun 12, 2023
@avara1986 avara1986 deleted the avara1986/APPSEC-9946-rc-error-overriding-payloads branch June 12, 2023 16:23
github-actions bot pushed a commit that referenced this pull request Jun 12, 2023
When Remote Configuration (RC) receives new configurations, the RC
Client has two kinds of actions: removing target file configurations and
loading new target file configurations.

The problem arises when we receive both kinds of actions simultaneously,
as the load action overrides the remove action. This error occurs if
someone creates and removes Dynamic Instrumentation Probes rapidly,
within a time interval shorter than the Remote Config interval (5s).

To fix this issue, we append all new configurations and configurations
to remove, and dispatch them at the end of the RC request.

## Checklist
- [x] Change(s) are motivated and described in the PR description.
- [x] Testing strategy is described if automated tests are not included
in the PR.
- [x] Risk is outlined (performance impact, potential for breakage,
maintainability, etc).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/contributing.html#Release-Note-Guidelines)
are followed.
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/)).

## Reviewer Checklist

- [x] Title is accurate.
- [x] No unnecessary changes are introduced.
- [x] Description motivates each change.
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes unless absolutely necessary.
- [x] Testing strategy adequately addresses listed risk(s).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] Release note makes sense to a user of the library.
- [x] Reviewer has explicitly acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment.

(cherry picked from commit b1000fd)
avara1986 added a commit that referenced this pull request Jun 14, 2023
Backport b1000fd from #6070 to 1.15.

When Remote Configuration (RC) receives new configurations, the RC
Client has two kinds of actions: removing target file configurations and
loading new target file configurations.

The problem arises when we receive both kinds of actions simultaneously,
as the load action overrides the remove action. This error occurs if
someone creates and removes Dynamic Instrumentation Probes rapidly,
within a time interval shorter than the Remote Config interval (5s).

To fix this issue, we append all new configurations and configurations
to remove, and dispatch them at the end of the RC request.

## Checklist
- [x] Change(s) are motivated and described in the PR description.
- [x] Testing strategy is described if automated tests are not included
in the PR.
- [x] Risk is outlined (performance impact, potential for breakage,
maintainability, etc).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/contributing.html#Release-Note-Guidelines)
are followed.
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/)).

## Reviewer Checklist

- [x] Title is accurate.
- [x] No unnecessary changes are introduced.
- [x] Description motivates each change.
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes unless absolutely necessary.
- [x] Testing strategy adequately addresses listed risk(s).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] Release note makes sense to a user of the library.
- [x] Reviewer has explicitly acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment.

Co-authored-by: Alberto Vara <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ASM Application Security Monitoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants