Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix obfuscate_sql_with_metadata wrapper memory usage #11815

Merged
merged 9 commits into from
Apr 12, 2022

Conversation

alexbarksdale
Copy link
Member

@alexbarksdale alexbarksdale commented Apr 11, 2022

What does this PR do?

Updates the obfuscate_sql_with_metadata wrapper to prevent unnecessarily throwing exceptions from decoding attempts. We found that orjson leaks memory when failing to parse these strings which are not valid json.

Note, this change is only relevant when integrations are running on an agent before 7.34.

Relevant PR: DataDog/datadog-agent#10042

Motivation

Before
Screen Shot 2022-04-11 at 5 24 31 PM

After
Screen Shot 2022-04-11 at 5 24 54 PM

Additional Notes

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached

@codecov
Copy link

codecov bot commented Apr 11, 2022

Codecov Report

Merging #11815 (ff99d31) into master (f28b0ee) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Flag Coverage Δ
ambari 85.75% <ø> (ø)
avi_vantage 91.92% <ø> (ø)
calico 83.33% <ø> (ø)
citrix_hypervisor 87.50% <ø> (ø)
crio 89.79% <ø> (ø)
datadog_cluster_agent 90.00% <ø> (ø)
dns_check 93.84% <ø> (ø)
eks_fargate 94.05% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@alexbarksdale alexbarksdale marked this pull request as ready for review April 11, 2022 21:27
@alexbarksdale alexbarksdale requested review from a team as code owners April 11, 2022 21:27
@alexbarksdale alexbarksdale added bugfix/regression category/bugfix For use during Agent Release period labels Apr 11, 2022
@alexbarksdale alexbarksdale merged commit 69e3415 into master Apr 12, 2022
@alexbarksdale alexbarksdale deleted the alex.barksdale/update-obfuscator-wrapper branch April 12, 2022 14:17
steveny91 pushed a commit that referenced this pull request Apr 12, 2022
* Update obfuscator wrapper

* Cleanup

* Check statement type

* Handle whitespace and byte conversions

* fix nit

* Fix linting

* Revert tests and add comment for context

* Update comment

* Update comment
steveny91 pushed a commit that referenced this pull request Apr 14, 2022
* Update obfuscator wrapper

* Cleanup

* Check statement type

* Handle whitespace and byte conversions

* fix nit

* Fix linting

* Revert tests and add comment for context

* Update comment

* Update comment
djova added a commit that referenced this pull request Apr 18, 2022
Follow-up to #11815. Changelog must be manually updated in case of a patch release for an older version.
djova added a commit that referenced this pull request Jun 22, 2022
Follow-up to #11815. Changelog must be manually updated in case of a patch release for an older version.
github-actions bot pushed a commit that referenced this pull request Jun 22, 2022
Follow-up to #11815. Changelog must be manually updated in case of a patch release for an older version. 1c5521d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants