Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Aug 16, 2022

Conversation

olksdr
Copy link
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 jjbayer and a team August 15, 2022 10:47
@olksdr olksdr removed their assignment Aug 16, 2022
Copy link
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
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