Allow connection_pool to be set in RedisSettings#473
Open
brian-goo wants to merge 1 commit intopython-arq:mainfrom
Open
Allow connection_pool to be set in RedisSettings#473brian-goo wants to merge 1 commit intopython-arq:mainfrom
connection_pool to be set in RedisSettings#473brian-goo wants to merge 1 commit intopython-arq:mainfrom
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ ❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## main #473 +/- ##
==========================================
- Coverage 96.27% 96.01% -0.27%
==========================================
Files 11 11
Lines 1074 1079 +5
Branches 209 190 -19
==========================================
+ Hits 1034 1036 +2
- Misses 19 21 +2
- Partials 21 22 +1
Continue to review full report in Codecov by Sentry.
|
gaby
suggested changes
Oct 18, 2024
| assert settings.port == 123 | ||
| assert ( | ||
| "RedisSettings(host='localhost', port=123, unix_socket_path=None, database=0, username=None, password=None, " | ||
| "RedisSettings(connection_pool=None, host='localhost', port=123, unix_socket_path=None, database=0, username=None, password=None, " |
There was a problem hiding this comment.
Probably worth adding a test where the connectionpool is set
|
I'd also really like smoother support for connection pooling. My Arq enqueuer falls over really quickly in a production setting. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@samuelcolvin @chrisguidry
Thank you for a great library!
It would be really grateful if this PR could be reviewed or a workaround for this issue provided.
Many thanks.
We are using arq for our production app, and it appears that connection pool throws an error and
arq workercrashes if the connection limit(max_connections) is reached.Not only does worker but the
enqueue_jobmethod also throws an error under the same condition.This seems to be caused by the default
ConnectionPoolof redis-py.redis/redis-py#2517
Code to reproduce:
By allowing
connection_poolto be set in RedisSettings, it seems to work as expected.It appears that
Workercan takeredis_poolas an argument, but I guess we can handle this case more concisely this way for bothWorkerandEnqueuer, provided it does not break anything else.