feat(redis): Support streaming spans #6083
3 issues
Medium
Test assertion checks wrong span index - `tests/integrations/redis/test_redis_cache_module_async.py:301`
Line 301 asserts "cache.hit" not in spans[1]["data"] but the surrounding context is testing spans[2] (the cache.put span). This is likely a copy-paste error. The assertion passes trivially because spans[1] is a db.redis span which never has cache.hit, meaning the actual cache.put span (spans[2]) is not being verified for the absence of cache.hit.
Also found at:
tests/integrations/redis/test_redis_cache_module.py:331
Redis spans not properly closed when command raises an exception - `sentry_sdk/integrations/redis/_async_common.py:145-156`
In _sentry_execute_command, spans are entered via __enter__() but exit is only called via __exit__(None, None, None) after the command succeeds. If old_execute_command raises an exception (e.g., Redis connection error, timeout), db_span.__exit__() and cache_span.__exit__() are never called. This causes the span to remain unfinished, leaves the scope's active span in an inconsistent state, and prevents proper error status from being recorded on the span.
Also found at:
sentry_sdk/integrations/redis/_sync_common.py:145-156
Test checks wrong span index for cache.hit assertion - `tests/integrations/redis/test_redis_cache_module.py:331`
Line 331 asserts "cache.hit" not in spans[1]["data"] but spans[1] is a db.redis span (confirmed at line 324), not the cache.put span being validated. The assertion should reference spans[2] (the cache.put span identified at line 326) to actually verify that cache.put spans don't have a cache.hit attribute. This bug means the test is passing vacuously since db.redis spans don't have cache data.
Also found at:
tests/integrations/redis/test_redis_cache_module_async.py:293
4 skills analyzed
| Skill | Findings | Duration | Cost |
|---|---|---|---|
| code-review | 1 | 6m 45s | $4.58 |
| find-bugs | 2 | 7m 37s | $6.69 |
| skill-scanner | 0 | 8m 24s | $1.72 |
| security-review | 0 | 9m 42s | $1.71 |
Duration: 32m 29s · Tokens: 9.5M in / 100.5k out · Cost: $14.74 (+extraction: $0.02, +merge: $0.00, +dedup: $0.02, +fix_gate: $0.00)