-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
Cluster mode support #420
base: main
Are you sure you want to change the base?
Cluster mode support #420
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall seems like a reasonable feature, but there's a fair bit to clear up here.
Should we wait to add cluster support until after #437?
options: --entrypoint redis-server | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Test redis cluster |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add cluster tests separately from the main tests as redis-cluster-test
.
|
||
from .constants import default_queue_name, expires_extra_ms, job_key_prefix, result_key_prefix | ||
from .jobs import Deserializer, Job, JobDef, JobResult, Serializer, deserialize_job, serialize_job | ||
from .utils import timestamp_ms, to_ms, to_unix_ms | ||
|
||
logger = logging.getLogger('arq.connections') | ||
logging.basicConfig(level=logging.DEBUG) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logging.basicConfig(level=logging.DEBUG) |
@@ -27,7 +33,7 @@ class RedisSettings: | |||
Used by :func:`arq.connections.create_pool` and :class:`arq.worker.Worker`. | |||
""" | |||
|
|||
host: Union[str, List[Tuple[str, int]]] = 'localhost' | |||
host: Union[str, List[Tuple[str, int]]] = 'test-cluster.aqtke6.clustercfg.use2.cache.amazonaws.com' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
host: Union[str, List[Tuple[str, int]]] = 'test-cluster.aqtke6.clustercfg.use2.cache.amazonaws.com' | |
host: Union[str, List[Tuple[str, int]]] = 'localhost' |
the_job = Job(job_id, redis=self, _queue_name=_queue_name, _deserializer=self.job_deserializer) | ||
logger.debug(the_job) | ||
return the_job |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert.
class ArqRedisCluster(RedisCluster): # type: ignore | ||
""" | ||
Thin subclass of ``from redis.asyncio.cluster.RedisCluster`` which patches methods of RedisClusterPipeline | ||
to support redis cluster`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to support redis cluster`. | |
to support redis cluster. |
@@ -299,5 +391,5 @@ async def log_redis_info(redis: 'Redis[bytes]', log_func: Callable[[str], Any]) | |||
f'redis_version={redis_version} ' | |||
f'mem_usage={mem_usage} ' | |||
f'clients_connected={clients_connected} ' | |||
f'db_keys={key_count}' | |||
f'db_keys={88}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert
@@ -59,7 +59,7 @@ Changelog = 'https://github.com/samuelcolvin/arq/releases' | |||
testpaths = 'tests' | |||
filterwarnings = ['error'] | |||
asyncio_mode = 'auto' | |||
timeout = 10 | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this file?
Adds limited support for redis cluster mode. This was done by overwriting a few methods when
RedisSettings
has the newcluster_mode
flag on.