Skip to content

fix(redis): import redis pipeline using full path#1565

Merged
sl0thentr0py merged 2 commits intogetsentry:masterfrom
olksdr:fix/use-full-pipeline-path
Aug 16, 2022
Merged

fix(redis): import redis pipeline using full path#1565
sl0thentr0py merged 2 commits intogetsentry:masterfrom
olksdr:fix/use-full-pipeline-path

Conversation

@olksdr
Copy link
Copy Markdown
Contributor

@olksdr olksdr commented Aug 15, 2022

Currently Sentry uses redis-py-cluster==2.1.0 which does not expose the ClusterPipeline as a top level object. The fix was introduced in version 2.1.1 and another fix in 2.1.2 see https://github.com/Grokzen/redis-py-cluster/blob/master/docs/release-notes.rst

And getting following error

09:05:04 [INFO] sentry.plugins.github: apps-not-configured
Traceback (most recent call last):
  File "/Users/olksdr/dev/sentry/.venv/lib/python3.8/site-packages/sentry_sdk/integrations/redis.py", line 123, in setup_once
    _patch_rediscluster()
  File "/Users/olksdr/dev/sentry/.venv/lib/python3.8/site-packages/sentry_sdk/integrations/redis.py", line 88, in _patch_rediscluster
    pipeline_cls = rediscluster.ClusterPipeline
AttributeError: module 'rediscluster' has no attribute 'ClusterPipeline'

This PR makes sure to use the full path to import rediscluster.pipeline.ClusterPipeline which always available in any version now.

See errors in integration tests on getsentry/relay#1413 and getsentry/relay#1414 where the sentry master branch is used to run those tests with newly updated python sentry-sdk dependency.

Related changes which "broke" the sdk for redis-py-cluster==2.1.0 were introduced in #1543

@olksdr olksdr self-assigned this Aug 15, 2022
@olksdr olksdr requested review from a team and jjbayer August 15, 2022 10:47
@olksdr olksdr removed their assignment Aug 16, 2022
Copy link
Copy Markdown
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@olksdr Thanks for this!

Let's wait for SDK owners' approval before merging.

@sl0thentr0py
Copy link
Copy Markdown
Member

thx @olksdr I'm adding a test matrix entry from #1562 that captures this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants