question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

redis-py doesn't play well with multiprocessing

See original GitHub issue

I have been struggling with several python redis commands raising various ResponseError exceptions or returning illegal values. In all cases experienced so far, the nature is intermittent and I have been using wrapper code to help capture some of the behavior , at https://gist.github.com/namoopsoo/b9f082e9eac025f7ec3b .

I have some initial symptoms documented here, on http://stackoverflow.com/questions/24168124/python-redis-responseerror-protocol-error-unbalanced-quotes-in-request .

As mentioned at the above, running redis server 2.8.10 from Homebrew on Mac OS X, and

(venvstage)$ pip freeze | grep redis
hiredis==0.1.3
redis==2.10.1

I do not have code available that someone could run to easily reproduce these errors, since I am just experiencing this in my personal code. But, if needed, I can try to provide more detail.

I have not ruled out that maybe my code is causing the crashes, but I wanted to post this up in case it rang a bell for someone else.

Another bit of output captured is in https://gist.github.com/namoopsoo/fea6157ad4197cf25f24 .

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
bmerrycommented, Jul 14, 2017

Is there any update on this? I’m also using redis with multiprocessing, and while I haven’t yet hit any issues, I’d sleep better knowing that it was safe.

From what I can see, ConnectionPool will reset itself if it detects that the PID has changed, which ought to address the multiprocessing case. On the other hand, that was already the case with 2.10.1, so presumably there is something else that led to this bug.

0reactions
andymccurdycommented, Feb 17, 2019

3.2.0 fixes the issues with forked processes. Sorry for the long wait.

Read more comments on GitHub >

github_iconTop Results From Across the Web

redis-py doesn't play well with multiprocessing #496 - GitHub
I have been struggling with several python redis commands raising various ResponseError exceptions or returning illegal values.
Read more >
Redis pipelines and python multiprocessing - Stack Overflow
The simplest way with py-redis is by setting the transaction flag to True when calling pipeline. But only do this if you really...
Read more >
I agree wholeheartedly. Almost every time I hear from ...
Python's "multiprocessing" means launching another Python interpreter in a subprocess. Each process has a full copy of the Python environment.
Read more >
Python Multithreading and Multiprocessing Tutorial - Toptal
Threading is just one of the many ways concurrent programs can be built. In this article, we will take a look at threading...
Read more >
Understanding Multiprocessing in AWS Lambda with Python
I created a new AWS lambda function (with Python 3.6 runtime) and ran the following lines: import multiprocessing as mpdef lambda_handler(event, context):
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found