Skip to content

Commit ca3c521

Browse files
fix(avro): return result of wrapped serialize/deserialize when DSM enabled (#15503)
## Description When DSM is enabled, we aren't returning the function result for `DatumReader.read` and `DatumWriter.write`. This fixes that to make it consistent with the default behavior. ## Testing <!-- Describe your testing strategy or note what tests are included --> ## Risks <!-- Note any risks associated with this change, or "None" if no risks --> ## Additional Notes <!-- Any other information that would be helpful for reviewers -->
1 parent 2366f2d commit ca3c521

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ddtrace/contrib/internal/avro/patch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def _traced_serialize(func, instance, args, kwargs):
6262
active = pin.tracer.current_span()
6363

6464
try:
65-
func(*args, **kwargs)
65+
return func(*args, **kwargs)
6666
finally:
6767
if active:
6868
SchemaExtractor.attach_schema_on_span(instance.writers_schema, active, SchemaExtractor.SERIALIZATION)
@@ -80,7 +80,7 @@ def _traced_deserialize(func, instance, args, kwargs):
8080
active = pin.tracer.current_span()
8181

8282
try:
83-
func(*args, **kwargs)
83+
return func(*args, **kwargs)
8484
finally:
8585
reader = instance
8686
if active and reader:
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
fixes:
3+
- |
4+
avro: Fixes an issue where Avro instrumentation does not return method results when DSM is enabled.

0 commit comments

Comments
 (0)