Skip to content

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Nov 15, 2021

This is an automatic backport of pull request #3008 done by Mergify.


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

* fix(internal) cdef Python exceptions being ignored

In a cdef function `raise` statements will create a Python
exception, add it to the exception stack, and then immediately
return. However, the caller will not explicitly check to see if
any exception has occurred unless an exception return value has
been provided.

Until now these cdef functions when they encountered a `raise`
would push the Python exception, and then return the default
`int` value of `0`. Which based on how we use the return values
`0` means success.

This means that anytime we encounter an exception in our encoder
we potentially ignore any exceptions and still append the
partially encoded trace into the buffer.

With this change we are standardizing around `except? -1` which
tells the caller that their _might_ be a Python exception if the
return value is `-1`. We do this because the `msgpack_*`
functions we call will also return `-1` on error, but will not
create a Python exception.

* add release note

* Update integration tests

* remove unused import

* set file encoding

* Update releasenotes/notes/fix-encoding-exceptions-c12900b38741d2bf.yaml

Co-authored-by: Tahir H. Butt <tahir.butt@datadoghq.com>

Co-authored-by: Tahir H. Butt <tahir.butt@datadoghq.com>
(cherry picked from commit 1b6cec4)
@mergify mergify bot requested a review from a team as a code owner November 15, 2021 21:47
@brettlangdon brettlangdon merged commit a7f7b68 into 0.56 Nov 15, 2021
@brettlangdon brettlangdon deleted the mergify/bp/0.56/pr-3008 branch November 15, 2021 22:17
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.

3 participants