aws / aws/aws-xray-sdk-python

Unhandled AttributeError if reservoir is None

Open
#222 16 comments 0 reactions 1 assignee Claimed by @srprash View on GitHub
Dominant language
Python
Stars
338
Forks
147
PR merge metrics
No merged PRs in 30d

Description

Calling `reservoir.borrow_or_take(now, rule.can_borrow)` leads to an `AttributeError` if `reservoir is None`. See screenshot (sentry) for details.

![image](https://user-images.githubusercontent.com/152008/80094217-674c7600-8555-11ea-97fd-fd5965b2c29c.png)

Looks like a race condition caused by merging rules. We saw this in production, but only once.

https://github.com/aws/aws-xray-sdk-python/blob/2d12c83383ea42e955ad530a7c18832c7881fb32/aws_xray_sdk/core/sampling/rule_cache.py#L47-L50

https://github.com/aws/aws-xray-sdk-python/blob/2d12c83383ea42e955ad530a7c18832c7881fb32/aws_xray_sdk/core/sampling/sampling_rule.py#L71-L80

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.