celery变量共享
eventlet并发读写socket出现Second simultaneous问题

celery配合redis出现redis.exceptions.InvalidResponse Protocol Error

妙音 posted @ 2020年6月21日 09:29 in python with tags Redis Celery , 757 阅读

说明

 
celery+redis实现异步任务,如果涉及到频繁的io调用,可能会出现错误redis.exceptions.InvalidResponse: Protocol Error
 

错误内容

 
redis.exceptions.InvalidResponse: Protocol Error: {, b'\"status\": \"SUCCESS\", \"result\":xxxx \"traceback\": null, \"children\": [], \"date_done\": \"2020-06-04T07:47:38.317661\", \"task_id\": \"fd4e4fa1-f8cc-4083-a287-ac2b7c7d4472\"}'\r\n"
 

查看redis源码

                                                   
#connection.py
def read_response(self):
    response = self._buffer.readline()
    if not response:
        raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)

    byte, response = byte_to_chr(response[0]), response[1:]

    # 从redis源码中可以看出,通信的数据格式不对
    if byte not in ('-', '+', ':', '$', '*'):
        raise InvalidResponse("Protocol Error: %s, %s" %
                              (str(byte), str(response)))
 

原因

                                                   
从redis源码中可以看出,通信的数据格式不对.
具体为什么会格式不会, 猜测可能是celery使用了pipeline, socket重连之后,数据格式发生变化
 
 

解决办法

 
使用evenetlet进行改造,解决socket问题
 
 
                                                   
Avatar_small
Buy Mathworks Matlab 说:
2020年10月13日 18:31

Sewing Machines… [...]any time to read or go to the content or perhaps internet sites we certainly have associated with[...]…

Avatar_small
Erste Hilfe Kurs 说:
2020年10月14日 04:28

I like your post. It is good to see you verbalize from the heart and clarity on this important subject can be easily observed...

Avatar_small
Digital_Zone 说:
2020年10月20日 20:26

An interesting discussion may be worth comment. I do believe that you ought to write much more about this topic, it might certainly be a taboo subject but usually folks are too few to communicate on such topics. Yet another. Cheers Ramen en deuren

Avatar_small
Digital_Zone 说:
2020年10月20日 20:35

I impressed, I need to say. Really not often do I encounter a blog that each educative and entertaining, and let me tell you, you have hit the nail on the head. Your concept is outstanding; the problem is something that not sufficient persons are speaking intelligently about. I’m very comfortable that I stumbled across this in my seek for one thing referring to this. Vloerisolaties

Avatar_small
Digital_Zone 说:
2020年10月20日 20:37

This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here keep up the good work PVC ramen

Avatar_small
Digital_Zone 说:
2020年10月20日 20:41

Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! Chape

Avatar_small
Digital_Zone 说:
2020年10月20日 20:43

This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post. Aluminium ramen

Avatar_small
Digital_Zone 说:
2020年10月20日 20:45

You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers. Chapewerken

Avatar_small
Digital_Zone 说:
2020年10月20日 20:46

I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much. Noten kopen

Avatar_small
Digital_Zone 说:
2020年10月20日 20:49

What a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more number of posts like these. Thank you very much. PVC ramen en deuren

Avatar_small
Digital_Zone 说:
2020年10月20日 20:52

I admit, I have not been on this web page in a long time... however it was another joy to see It is such an important topic and ignored by so many, even professionals. I thank you to help making people more aware of possible issues. Vloerisolatie

Avatar_small
Digital_Zone 说:
2020年10月20日 20:54

very interesting post.this is my first time visit here.i found so mmany interesting stuff in your blog especially its discussion..thanks for the post! Ramen deuren

Avatar_small
Digital_Zone 说:
2020年10月20日 20:57

I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. Notenshop online

Avatar_small
Digital_Zone 说:
2020年10月20日 20:59

This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value. Im glad to have found this post as its such an interesting one! I am always on the lookout for quality posts and articles so i suppose im lucky to have found this! I hope you will be adding more in the future... Airco

Avatar_small
Digital_Zone 说:
2020年10月20日 21:02

Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. There tend to be not many people who can certainly write not so simple posts that artistically. Continue the nice writing Webdesign

Avatar_small
Digital_Zone 说:
2020年10月20日 21:04

I have read a few of the articles on your website now, and I really like your style of blogging. I added it to my favorites blog site list and will be checking back soon. Please check out my site as well and let me know what you think. Noten

Avatar_small
We Buy Houses in Mil 说:
2020年10月20日 21:04

Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work.

Avatar_small
Digital_Zone 说:
2020年10月20日 21:06

Nice to be visiting your blog again, it has been months for me. Well this article that i’ve been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share. Ramen in PVC

Avatar_small
Digital_Zone 说:
2020年10月20日 21:08

I found this is an informative and interesting post so i think so it is very useful and knowledgeable. I would like to thank you for the efforts you have made in writing this article. Webdesign

Avatar_small
Digital_Zone 说:
2020年10月20日 21:14

You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers. Airconditioning

Avatar_small
Digital_Zone 说:
2020年10月20日 21:17

Only aspire to mention ones content can be as incredible. This clarity with your post is superb and that i may think you’re a guru for this issue. High-quality along with your concur permit me to to seize your current give to keep modified by using approaching blog post. Thanks a lot hundreds of along with you should go on the pleasurable get the job done. Webdesign

Avatar_small
Digital_Zone 说:
2020年10月20日 21:19

An fascinating discussion is value comment. I think that it is best to write extra on this matter, it won’t be a taboo topic however generally people are not enough to talk on such topics. To the next. Cheers Airco installatie

Avatar_small
Digital_Zone 说:
2020年10月20日 21:21

I am unable to read articles online very often, but I’m glad I did today. This is very well written and your points are well-expressed. Please, don’t ever stop writing. Cashewnoten

Avatar_small
Digital_Zone 说:
2020年10月20日 21:23

That is the excellent mindset, nonetheless is just not help to make every sence whatsoever preaching about that mather. Virtually any method many thanks in addition to i had endeavor to promote your own article in to delicius nevertheless it is apparently a dilemma using your information sites can you please recheck the idea. thanks once more. Pur spuiten

Avatar_small
Digital_Zone 说:
2020年10月20日 21:25

I think this is an informative post and it is very beneficial and knowledgeable. Therefore, I would like to thank you for the endeavors that you have made in writing this article. All the content is absolutely well-researched. Thanks... Airco installateur

Avatar_small
Digital_Zone 说:
2020年10月20日 21:27

You have performed a great job on this article. It’s very precise and highly qualitative. You have even managed to make it readable and easy to read. You have some real writing talent. Thank you so much. Isolatiechape

Avatar_small
Digital_Zone 说:
2020年10月20日 21:29

I am incapable of reading articles online very often, but I’m happy I did today. It is very well written, and your points are well-expressed. I request you warmly, please, don’t ever stop writing. Reiki

Avatar_small
Digital_Zone 说:
2020年10月20日 21:32

Wow, What an Outstanding post. I found this too much informatics. It is what I was seeking for. I would like to recommend you that please keep sharing such type of info.If possible, Thanks. Granola

Avatar_small
Digital_Zone 说:
2020年10月20日 21:34

Fabulous post, you have denoted out some fantastic points, I likewise think this s a very wonderful website. I will visit again for more quality contents and also, recommend this site to all. Thanks. Pur isolatie

Avatar_small
buy benzylpiperazine 说:
2020年10月26日 04:38

Love to read it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks. buy benzylpiperazine with Paypal online

Avatar_small
Albert Strickland 说:
2020年11月07日 18:54

I read your blog frequently, and I just thought I’d say keep up the fantastic work! It is one of the most outstanding blogs in my opinion. Yogurt smoothie

Avatar_small
Diane Jones 说:
2020年12月01日 00:56

Find out Reliable and Legit Ways for Extra Income from Home. You are welcome to our scam free world of online earning. legit extra income from home

Avatar_small
Denise Carroll 说:
2020年12月03日 20:11

Expert Automation BD provides solution for Auto Rolling Shutter, Automatic Sensor Pedestrian Door, Automatic Gate Opener, Automatic Garage Door, Swing Gate Opener Complete System, Car Parking Barrier, Intelligent Car Parking System, Toll Management System, Automation, Security System, Embedded Controller Design, Tripod Turnstile, IOT Solution, Flap Barrier, Full Turnstiles Gate Solution, Full Height Barrier, Car Barrier and heavy constructions materials on rental basis. automatic rolling shutter

Avatar_small
Garnet Kirsikka 说:
2020年12月10日 02:03

Kerala SPARK login is an initiative by Finance Department, Government of Kerala for the employees who’s Service and Payroll Administrative Repository is maintained in SPARK project, and the portal will provide the employees their Salary Slip view, Leave Management, Outside Duty and Compensatory Off requests and more. Spark Login

Avatar_small
visit this site 说:
2020年12月15日 21:46

I am thankful to you for sharing this plethora of useful information. I found this resource utmost beneficial for me. Thanks a lot for hard work.

Avatar_small
alam 说:
2020年12月19日 16:16

Believe it or not, it is the type of information I’ve long been trying to find. It matches to my requirements a lot. Thank you for writing this information. 인싸포커

Avatar_small
section 80g 说:
2020年12月19日 21:52

A very excellent blog post. I am thankful for your blog post. I have found a lot of approaches after visiting your post.

Avatar_small
alam 说:
2020年12月21日 16:00

This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post. custom velcro patches

Avatar_small
ac repair in Delhi 说:
2020年12月22日 01:46

All your hard work is much appreciated. Nobody can stop to admire you. Lots of appreciation.

Avatar_small
토토사이트 说:
2020年12月23日 15:22

Personally I think overjoyed I discovered the blogs.

Avatar_small
Pak24tv 说:
2020年12月26日 13:25

I am happy to find your distinguished way of writing the post. Now you make it easy for me to understand and implement the concept. Thank you for the post. top 10 poorest countries in the world top 10 most beautiful places in the world top 10 most expensive cities in the world top 10 most beautiful countries in the world

Avatar_small
먹튀 说:
2020年12月26日 23:15

I wanted to thank you for this excellent read!! I definitely loved every little bit of it. I have you bookmarked your site to check out the new stuff you post.

Avatar_small
Edward Bartoletti 说:
2020年12月28日 23:48

MSBSHSE SSC Examination every year more than laks of students So, the candidates can practice the Maharashtra 10th Model Paper 2021 & Sample Questions Paper. Applicants need to complete the given by placing a correct Previous Model Paper in it. Competitors who are having the necessary knowledge The Candidates can know all the points by practicing Maharashtra SSC Examination the provided Sample Paper 2021 regarding General English. The definite the Maharashtra 10th Bit Bank, Question Bank and pervious Paper, Model Paper 2021 is used when the referent of the noun phrase is assumed to be unique or known from the sample paper For more information on Paper usage, see the Sample Paper 2021 Given Below inter Model Paper 2021. Maha Board SSC Model Paper 2021

Avatar_small
Denise Carroll 说:
2020年12月31日 16:46

Thanks for an interesting blog. What else may I get that sort of info written in such a perfect approach? I have an undertaking that I am just now operating on, and I have been on the lookout for such info. usługi towarzyskie

Avatar_small
prizebondlist.com.pk 说:
2021年1月04日 21:42

I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day!

Avatar_small
t shirts with saying 说:
2021年1月05日 23:54

I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us.

Avatar_small
pet waste removal Da 说:
2021年1月06日 01:46

Great blog, I am going to spend more time reading about this subject

Avatar_small
alam 说:
2021年1月07日 18:06

Thanks for your insight for your fantastic posting. I’m glad I have taken the time to see this. 메이저놀이터

Avatar_small
funny t shirts for w 说:
2021年1月08日 23:34

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info.

Avatar_small
notary td bank lakel 说:
2021年1月11日 01:22

This is a brilliant blog! I'm very happy with the comments!..

Avatar_small
remote online notary 说:
2021年1月11日 01:37

I admire what you have done here. I like the part where you say you are doing this to give back but I would assume by all the comments that this is working for you as well.

Avatar_small
how to grow eyebrows 说:
2021年1月13日 01:53

Your articles are inventive. I am looking forward to reading the plethora of articles that you have linked here. Thumbs up!

Avatar_small
suraj 说:
2021年1月13日 14:09

Your blog provided us with valuable information to work with. Each & every tips of your post are awesome. Thanks a lot for sharing. <a href="https://www.ngoregistrationindelhi.com">ngo consultancy</a>

Avatar_small
AREE 说:
2021年1月13日 21:04

Thanks for your insight for your fantastic posting. I’m glad I have taken the time to see this. check this out

Avatar_small
https://lexmove.org/ 说:
2021年1月15日 03:22

I think that thanks for the valuabe information and insights you have so provided here.

Avatar_small
https://24securenow 说:
2021年1月17日 21:09

Im no expert, but I believe you just made an excellent point. You certainly fully understand what youre speaking about, and I can truly get behind that.

Avatar_small
kumar 说:
2021年1月18日 18:16

I would highly recommend John as a business advisor to anyone who is looking to make their business thrive. <a href="https://www.80g.co">Section 80g</a>

Avatar_small
check this out 说:
2021年1月18日 22:50

I am happy to find this post very useful for me, as it contains lot of information. I always prefer to read the quality content and this thing I found in you post. Thanks for sharing.

Avatar_small
kumar 说:
2021年1月20日 13:17

He is excells as a marketing consultant, business consultant and business leader. <a href="https://www.80g.co">80g</a>

Avatar_small
Online Cake Delivery 说:
2021年1月21日 22:37

What is an outstanding post! “I’ll be back” (to read more of your content). Thanks for the nudge!

Avatar_small
Online Cake Deliver 说:
2021年1月23日 18:23

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info.

Avatar_small
poker online terperc 说:
2021年1月23日 18:26

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info.

Avatar_small
schlüsseldienst müns 说:
2021年1月23日 18:37

This was a really great contest and hopefully I can attend the next one. It was alot of fun and I really enjoyed myself..

Avatar_small
click here 说:
2021年1月25日 01:36

You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers.

Avatar_small
KUMAR 说:
2021年1月25日 15:46

Address - Office no 204, 45b, 1st Floor, Hasanpur Main Road,
Patparganj, I.P. Extension, Delhi - 110092
https://www.80g.c

Avatar_small
http://buyoutubesubs 说:
2021年1月25日 17:26

Great Information sharing .. I am very happy to read this article .. thanks for giving us go through info.Fantastic nice. I appreciate this post.

Avatar_small
Denise Carroll 说:
2021年1月25日 19:56

That appears to be excellent however i am still not too sure that I like it. At any rate will look far more into it and decide personally! ソフト闇金安心

Avatar_small
ร้านขายอุปกรณ์เบเกอ 说:
2021年1月25日 20:42

I visit your blog regularly and recommend it to all of those who wanted to enhance their knowledge with ease. The style of writing is excellent and also the content is top-notch. Thanks for that shrewdness you provide the readers!

Avatar_small
prizebondlucky 说:
2021年1月26日 01:07

thanks for this usefull article, waiting for this article like this again.

Avatar_small
how to get more yout 说:
2021年1月27日 23:10

Hello, I have browsed most of your posts. This post is probably where I got the most useful information for my research. Thanks for posting, maybe we can see more on this. Are you aware of any other websites on this subject.

Avatar_small
Denise Carroll 说:
2021年1月28日 00:57

Thank you so much as you have been willing to share information with us. We will forever admire all you have done here because you have made my work as easy as ABC. ソフト闇金安心に借入が出来る所


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter