Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1ea7768

Browse files
authoredMay 29, 2024
Merge pull request #434 from majanjua-amzn/master
Fix warning message condition for subsegment ending
2 parents e65d05b + e62f0c5 commit 1ea7768

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎aws_xray_sdk/core/context.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,13 @@ def end_subsegment(self, end_time=None):
7878
:param float end_time: epoch in seconds. If not specified the current
7979
system time will be used.
8080
"""
81-
subsegment = self.get_trace_entity()
82-
if self._is_subsegment(subsegment):
83-
subsegment.close(end_time)
81+
entity = self.get_trace_entity()
82+
if self._is_subsegment(entity):
83+
entity.close(end_time)
8484
self._local.entities.pop()
8585
return True
86+
elif isinstance(entity, DummySegment):
87+
return False
8688
else:
8789
log.warning("No subsegment to end.")
8890
return False

0 commit comments

Comments
 (0)
Please sign in to comment.