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(redis): define result for try/catch [backport 2.10] #9861

Merged
merged 3 commits into from
Jul 23, 2024

Conversation

github-actions[bot]
Copy link
Contributor

Backport 3d8ba40 from #9786 to 2.10.

Prior to this change one of the redis_utils functions attempted to call a function in a try/catch with result=result with result being defined within the try.

This caused "undefined variable" errors to be raised when the exception was hit.

After this change, result is initialized as None before the try/catch, preventing the "undefined variable" errors"

Checklist

  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

Prior to this change one of the redis_utils functions attempted to call
a function in a try/catch with `result=result` with result being defined
within the try.

This caused "undefined variable" errors to be raised when the exception
was hit.

After this change, result is initialized as None before the try/catch,
preventing the "undefined variable" errors"

## Checklist

- [ ] The PR description includes an overview of the change
- [ ] The PR description articulates the motivation for the change
- [ ] The change includes tests OR the PR description describes a
testing strategy
- [ ] The PR description notes risks associated with the change, if any
- [ ] Newly-added code is easy to change
- [ ] The change follows the [library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- [ ] The change includes or references documentation updates if
necessary
- [ ] Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist

- [x] Title is accurate
- [x] All changes are related to the pull request's stated goal
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- [x] Testing strategy adequately addresses listed risks
- [x] Newly-added code is easy to change
- [x] Release note makes sense to a user of the library
- [x] If necessary, author has acknowledged and discussed the
performance implications of this PR as reported in the benchmarks PR
comment
- [x] Backport labels are set in a manner that is consistent with the
[release branch maintenance
policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)

(cherry picked from commit 3d8ba40)
@github-actions github-actions bot requested review from a team as code owners July 17, 2024 12:51
@datadog-dd-trace-py-rkomorn
Copy link

datadog-dd-trace-py-rkomorn bot commented Jul 17, 2024

Datadog Report

Branch report: backport-9786-to-2.10
Commit report: 6e7f8f0
Test service: dd-trace-py

✅ 0 Failed, 352 Passed, 541 Skipped, 8m 5.72s Total duration (3m 21.29s time saved)

@pr-commenter
Copy link

pr-commenter bot commented Jul 17, 2024

Benchmarks

Benchmark execution time: 2024-07-19 13:10:38

Comparing candidate commit 352d456 in PR branch backport-9786-to-2.10 with baseline commit bbbc041 in branch 2.10.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 213 metrics, 9 unstable metrics.

@gnufede gnufede enabled auto-merge (squash) July 23, 2024 06:35
@gnufede gnufede merged commit aa5615a into 2.10 Jul 23, 2024
64 of 74 checks passed
@gnufede gnufede deleted the backport-9786-to-2.10 branch July 23, 2024 06:52
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.

4 participants