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

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

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

说明

 
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
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
Imamia Quran Academy 说:
2023年7月16日 06:09

Hi everyone, I really love your story. You have a good taste of design; I hope i can be like you. I am from Imamia Quran Academy. Imamia Online Quran Academy has encompassed this field of Online Shia Quran Memorization too. They understand the urge of every Muslim to become Hafiz-e-Quran.

 

Avatar_small
hassan 说:
2023年10月24日 19:10

Thanks for this grand post, I am glad I detected this internet site on yahoo. zeve human hair

Avatar_small
rimaakter 说:
2023年11月09日 17:31

Cách tạo trò chơi Bangin' Metal mà không cần thiếc

 

Kênh Gamek chuyên cập nhật tổng hợp thông tin điện tử về game mới nhất trong nước và thế giới với đa dạng trò chơi gấp dẫn hiện nay.Gamek là địa chỉ cập nhật tin game mới nhất, nhanh nhất trong 24h cho các anh em game thủ Việt Nam. Tại đây, các tin tức game online, code game, riview game hay,... được cập nhật liên tục cho anh em tham khảo và lựa chọn.  vui lòng truy cập vào đây gamek để biết thêm thông tin.

 

Avatar_small
rimaakter 说:
2023年11月13日 13:15

Kenhacai5 Cá Cược Thể Thao Trực Tuyến

 

Kèo Nhà Cái Ngon là một trang web cá cược uy tín và chất lượng giúp các bạn trải nghiệm những trận đấu và cơ hội cá cược không giới hạn Cá cược thể thao trực tuyến ngày càng trở nên phổ biến đối với những người đam mê thể thao cũng như những người đặt cược thông thường. Với sự tiện lợi của việc đặt cược thoải mái ngay tại nhà riêng, nhiều lựa chọn cá cược và cơ hội thắng lớn, không có gì ngạc nhiên khi ngày càng có nhiều người chuyển sang nền tảng trực tuyến cho nhu cầu cá cược thể thao của họ. Một trong những nền tảng đã được công nhận trong những năm gần đây là Keonacai5, một trang cá cược thể thao trực tuyến đáng tin cậy. vui lòng truy cập vào đây  keonhacai5  để biết thêm thông tin.

 

Avatar_small
rimaakter 说:
2023年11月13日 13:37

Kenhacai5 Cá Cược Thể Thao Trực Tuyến

 

Kèo Nhà Cái Ngon là một trang web cá cược uy tín và chất lượng giúp các bạn trải nghiệm những trận đấu và cơ hội cá cược không giới hạn Cá cược thể thao trực tuyến ngày càng trở nên phổ biến đối với những người đam mê thể thao cũng như những người đặt cược thông thường. Với sự tiện lợi của việc đặt cược thoải mái ngay tại nhà riêng, nhiều lựa chọn cá cược và cơ hội thắng lớn, không có gì ngạc nhiên khi ngày càng có nhiều người chuyển sang nền tảng trực tuyến cho nhu cầu cá cược thể thao của họ. Một trong những nền tảng đã được công nhận trong những năm gần đây là Keonacai5, một trang cá cược thể thao trực tuyến đáng tin cậy. vui lòng truy cập vào đây  kèo nhà cái 5 để biết thêm thông tin.

 

 

Avatar_small
hassan 说:
2023年11月26日 19:51

I really delighted to find this internet site on bing, just what I was searching for : D too saved to fav. πασχαλινή λαμπάδα

Avatar_small
บาคาร่า 说:
2023年12月06日 17:13

I went over this site and I believe you have a lot of fantastic information, saved to favorites (:. <a href="https://baccarat8888.com/">บาคาร่า</a>

Avatar_small
usama 说:
2023年12月07日 19:53

I went over this site and I believe you have a lot of fantastic information, saved to favorites (:. เว็บแทงบอล

Avatar_small
CAB주소 说:
2023年12月09日 16:07

I got what you intend,bookmarked , very decent internet site . <a href="https://www.cabjuso.com/">CAB주소</a>

Avatar_small
SEO permanent backli 说:
2023年12月11日 17:59

Questioning why travelers who book directly with travel operators still often pay the full retail price and not a wholesale or outlet price. The proliferation of 'factory outlets' or 'manufacturer-direct' prices has become common place, but are we getting true 'outlet or direct' prices? <a href="https://www.fiverr.com/afiabacklinks/35-high-trust-flow-and-citation-flow-backlinks-on-high-da">SEO permanent backlinks</a>

Avatar_small
usama 说:
2023年12月12日 16:58

Sweet web site , super layout, real clean and utilize pleasant. 온라인슬롯

Avatar_small
usama 说:
2023年12月16日 15:21

Sweet web site , super layout, real clean and utilize pleasant. 메이저놀이터

Avatar_small
hassan 说:
2023年12月16日 15:28

This is a good blog. Keep up all the work. I too love to blog. This is great everyone sharing opinions 토토검증

Avatar_small
ahmed 说:
2023年12月19日 18:01

I like this site very much so much superb info . businessmarketonline

Avatar_small
radioevangeliovivo.n 说:
2023年12月19日 18:41

Good day! This is kind of off topic but I need some help from an established blog. Is it very difficult to set up your own blog? I’m not very techincal but I can figure things out pretty fast. I’m thinking about setting up my own but I’m not sure where to start. Do you have any tips or suggestions? Appreciate it <a href="https://radioevangeliovivo.net">radioevangeliovivo.net</a>

Avatar_small
huza, 说:
2023年12月20日 19:46

你好我的家人!我想说这篇文章非常棒,写得很棒,并且包含了几乎所有重要的信息。我想浏览更多这样的帖子。 網上賭場投注限制

Avatar_small
ahmed 说:
2023年12月21日 16:11

Obtaining a visa can be achieved with the help of your service provider. Visas are required, especially if you have to hire an employee. As the holder of a UAE business license, you also have the power to sponsor others for their visa too. The number of visas you can apply for will depend on the size of your company or business, the type of company you choose, and your earnings. SEO permanent backlinks

Avatar_small
ahmed 说:
2024年1月02日 14:42

Casinos are a place where in you can feature the highest quality gambling activities and its emergence has made online casinos a very realistic term. Now you can feature high quality casino games by just sitting in the comfort zone of your home. These online games are many a times known as virtual casino games or internet casino games. Permanent Homepage Backlinks

Avatar_small
Imamia Quran Academy 说:
2024年1月18日 08:28

Online Shia Quran Academy is an institute for Quran Education. They have trained teaching staff along with renowned Islamic Scholars for a better understanding of the Quran. Shia Quran Academy is an Online Ahle Tashi Institute that has all the features of traditional madrasahs including the teaching of an authentic understanding of the Quran. Additionally, Shia Quran Academy Online provides all teaching by certified professional teachers. Thus, joining Quran Academy will be suitable and beneficial for every learner. It is very difficult to find a good Online Shia Quran Center with Shia Teachers abroad except in Muslim or especially Ahle Tashi majority countries. Imamia Quran Center connects students virtually from all over the world including countries with less or no Ahle Tashi population or Shia Quran Centers. Our Quran Academy is a comprehensive institution with full fledged facilities regarding Shia Quran Learning. Ahle Tashi Quran student is free to choose the timings of classes, lecturers and tutors according to their feasibility and availability to Learn Shia Quran. Online learning more efficiently saves time and money spent over conveyance and physical going to any conventional Shia Quran Institute. Online Shia Madrasa selects highly qualified Quran teachers, keeping in mind the ages of kids and adults, who teach kids and adults Quranic education as well as their beliefs, spirituality and worldly life. The Shia Quran Madrasa Online is a secure place for kids and adults to learn and memorize the Quran. They teach the translation and interpretation of the Holy Quran under the guidance of expert Quranic teachers. Our Shia Quran Madrasa is second to none in providing education to Ahle Tashi women’s. So our center has selected Ahle Tashi Female Quran teacher with higher education from Madrasas. Online Shia Quran Madrasa is one of the best academies providing its services all over the world including USA, UK, Canada, Germany, France and Australia. Shia Quran Academy, a leading Online Shia Academy in the USA, offers exceptional virtual services that are accessible to anyone worldwide.

Avatar_small
메이저놀이터 추천 说:
2024年1月20日 18:01

Magnificent goods from you, man. I have understand your stuff previous to and you are just extremely excellent. I really like what you’ve acquired here, certainly like what you are saying and the way in which you say it. You make it enjoyable and you still care for to keep it sensible. I can not wait to read much more from you. This is actually a wonderful web site. <a href="https://www.tototrends.com/majorsite/">메이저놀이터 추천</a>

Avatar_small
sunwin-games.com 说:
2024年8月19日 09:39

SunWin tự hào là điểm đến hàng đầu cho những anh em yêu thích trải nghiệm niềm hứng khởi và sự chân thật trong từng ván cược, trò chơi trực tuyến.Website: https://sunwin-games.com/

Avatar_small
Sbobet 说:
2024年8月24日 06:19

Sbobet la dai ly chinh thuc cua Sbobet, cung cap link truy cap, dang ky, va dang nhap khong bi chan, dong thoi cap nhat cac chuong trinh khuyen mai va huong dan cho nguoi choi moi. Website: sbobet.nyc

Avatar_small
S666 说:
2024年9月05日 18:06

s666 la trang chu chinh thuc cua nha cai S666 tai Viet Nam. Truy cap website va dang ky tai khoan thong qua duong link cung cap tu chung toi de nhan ngay 66K trai nghiem Website: https://s666z.casino/


登录 *


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