opentelemetry-python-contrib
opentelemetry-python-contrib copied to clipboard
Check for None result in gRPC (#3380)
trafficstars
Description
This is a fix for #3380 that checks explicitly for a None result rather than evaluating truthiness. PubSub results with zero messages evaluate to False, causing span.end() to be called twice.
Fixes #3380
Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
- [x] Ran Tox
- [x] Ran locally against an empty PubSub queue and no longer received warning messages, but spans correctly started and ended.
- [x] Ran against queue with messages and behavior was as expected (spans correctly started and ended, as before)
Does This PR Require a Core Repo Change?
- [ ] Yes. - Link to PR:
- [x] No.
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.
- [x] Followed the style guidelines of this project
- [ ] Changelogs have been updated
- [ ] Unit tests have been added
- [ ] Documentation has been updated