RedisLabs / redis-cluster-proxy

A proxy for Redis clusters.
GNU Affero General Public License v3.0
998 stars 132 forks source link

Invalid bulk size error when using pipeline on redis-py #88

Open shayrybak opened 3 years ago

shayrybak commented 3 years ago

Hi,

I'm using redis-py 3.5.3 with python 3.6.9 to connect my application to a redis cluster version 6.0.9 using redis-cluster-proxy from master branch.

Some requests go through without issues, but the client is erroring with Redis exception: Connection closed by server on the proxy I've enabled debug mode and saw the following type of errors: [2020-12-27 15:17:43.007/1] Failed to parse request 1:58:6 [2020-12-27 15:17:43.007/1] Request 1:58:6 parsing error: 'Protocol error: invalid bulk length' [2020-12-27 15:17:43.007/1] Request 1:58:6 buffer: "*4\r\n$4\r\nHSET\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$21\r\nsession_js_exe_status\r\n$0\r\n\r\n*4\r\n$4\r\nHSET\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$21\r\nsession_js_exe_status\r\n$13\r\nexecuted once\r\n*4\r\n$4\r\nHSET\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$4\r\npops\r\n$14\r\n180306-vir-us;\r\n*4\r\n$7\r\nHINCRBY\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$10\r\npops_count\r\n$1\r\n1\r\n*4\r\n$4\r\nHSET\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$7\r\nrefresh\r\n$10\r\n1609082254\r\n*4\r\n$4\r\nHSET\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$2\r\nGB\r\n$10\r\n1609082254\r\n*4\r\n$7\r\nHINCRBY\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$9\r\ncountries\r\n$1\r\n1\r\n*4\r\n$4\r\nHSET\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$9\r\ninitiated\r\n$10\r\n1609082254\r\n*4\r\n$7\r\nHINCRBY\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$16\r\ninjected_req_num\r\n$1\r\n1\r\n*4\r\n$7\r\nHINCRBY\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$16\r\nevasive_requests\r\n$1\r\n1\r\n*4\r\n$4\r\nHSET\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$17\r\ninjected_last_req\r\n$14\r\n1608661602.663\r\n*4\r\n$7\r\nHINCRBY\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$15\r\ninjected_hf_num\r\n$1\r\n1\r\n*4\r\n$7\r\nHINCRBY\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$12\r\nno_ui_events\r\n$1\r\n1\r\n*4\r\n$7\r\nHINCRBY\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$13\r\ndynamic_pages\r\n$1\r\n1\r\n*4\r\n$4\r\nHSET\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$8\r\nlast_url\r\n$16\r\n/tests/login.htm\r\n*4\r\n$4\r\nHSET\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$6\r\nsp_lit\r\n$24\r\nbpdhOiGUl1s5B5jd8xeSyw==\r\n*4\r\n$4\r\nHSET\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$19\r\ninjection_timestamp\r\n$10\r\n1608661602\r\n*4\r\n$4\r\nHSET\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$17\r\nautomation_string\r\n$57\r\nobsvl||71d5a84d5f80079383bb41230fad086e||/tests/login.htm\r\n*4\r\n$4\r\nHSET\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$22\r\nautomation_string_time\r\n$10\r\n1608661602\r\n*4\r\n$4\r\nHSET\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$13\r\nreq_timestamp\r\n$10\r\n1608661602\r\n*3\r\n$6\r\nEXPIRE\r\n$76\r\ntact:behave5.sanity.fblcloud-qa.net:session:41e735a99001a3928ed6348d7ceaf0ea\r\n$3\r\n300\r\n*4\r\n$4\r\nHSET\r\n$50\r\ntact:behave5.sanity.fblcloud-qa.net:ip:80.40.40.41\r\n$7\r\nrequest\r\n$10\r\n1609082254\r\n*4\r\n$7\r\nHINCRBY\r\n$50\r\ntact:behave5.sanity.fblcloud-qa.net:ip:80.40.40.41\r\n$15\r\nnum_of_requests\r\n$1\r\n1\r\n*4\r\n$4\r\nHSET\r\n$50\r\ntact:behave5.sanity.fblcloud-qa.net:ip:80.40.40.41\r\n$12\r\nnew_sessions\r\n$1\r\n1\r\n*4\r\n$4\r\nHSET\r\n$50\r\ntact:behave5.sanity.fblcloud-qa.net:ip:80.40.40.41\r\n$11\r\nnew_session\r\n$10\r\n1609082254\r\n*4\r\n$4\r\nHSET\r\n$50\r\ntact:behave5.sanity.fblcloud-qa.net:ip:80.40.40.41\r\n$16\r\ninjected_req_num\r\n$1\r\n1\r\n*4\r\n$4\r\nHSET\r\n$50\r\ntact:behave5.sanity.fblcloud-qa.net:ip:80.40.40.41\r\n$27\r\ninjected_first_req_sequance\r\n$10\r\n1609082254\r\n*4\r\n$4\r\nHSET\r\n$50\r\ntact:behave5.sanity.fblcloud-qa.net:ip:80.40.40.41\r\n$26\r\ninjected_last_req_sequance\r\n$10\r\n1609082254\r\n*4\r\n$4\r\nHSET\r\n$50\r\ntact:behave5.sanity.fblcloud-qa.net:ip:80.40.40.41\r\n$16\r\nfake_ua_sessions\r\n$1\r\n0\r\n*4\r\n$4\r\nHSET\r\n$50\r\ntact:behave5.sanity.fblcloud-qa.net:ip:80.40.40.41\r\n$22\r\ninjected_fast_sessions\r\n$1\r\n0\r\n*4\r\n$4\r\nHSET\r\n$50\r\ntact:behave5.sanity.fblcloud-qa.net:ip:80.40.40.41\r\n$15\r\nmapper_last_url\r\n$16\r\n/tests/login.htm\r\n*4\r\n$7\r\nHINCRBY\r\n$50\r\ntact:behave5.sanity.fblcloud-qa.net:ip:80.40.40.41\r\n$14\r\nlogin_attempts\r\n$1\r\n1\r\n*4\r\n$4\r\nHSET\r\n$50\r\ntact:behave5.sanity.fblcloud-qa.net:ip:80.40.40.41\r\n$13\r\nlogin_attempt\r\n$10\r\n1609082254\r\n*4\r\n$4\r\nHSET\r\n$50\r\ntact:behave5.sanity.fblcloud-qa.net:ip:80.40.40.41\r\n$8\r\nlast_url\r\n$16\r\n/tests/login.htm\r\n*4\r\n$4\r\nHSET\r\n$50\r\ntact:behave5.sanity.fblcloud-qa.net:ip:80.40.40.41\r\n$9\r\nlast_args\r\n$0\r\n\r\n*4\r\n$4\r\nHSET\r\n$50\r\ntact:behave5.sanity.fblcloud-qa.net:ip:80.40.40.41\r\n$17\r\ninjected_last_req\r\n$14\r\n1608661602.663\r\n*4\r\n$7\r\nHINCRBY\r\n$50\r\ntact:behave5.sanity.fblcloud-qa.net:ip:80.40.40.41\r\n$15\r\ninjected_hf_num\r\n$1\r\n1\r\n*3\r\n$6\r\nEXPIRE\r\n$50\r\ntact:behave5.sanity.fblcloud-qa.net:ip:80.40.40.41\r\n$5\r\n43200\r\n*4\r\n$4\r\nHSET\r\n$80\r\ntact:behave5.sanity.fblcloud-qa.net:usertag:h4f7bcb74c5c2f802504cf113127e2fb4d35\r\n$14\r\nnofixedusertag\r\n$10\r\n1609082254\r\n*3\r\n$6\r\nEXPIRE\r\n$80\r\ntact:behave5.sanity.fblcloud-qa.net:usertag:h4f7bcb74c5c2f802504cf113127e2fb4d35\r\n$6\r\n172800\r\n"

The client is using pipelining in order to reduce overhead.

Does the proxy have a limit on the size of the pipeline?

If it does, is that configurable?

Regards, Shay

huxiaozhe commented 3 years ago

Problem with protocol resolution ,redis-cluster-proxy bug

pnthai88 commented 3 years ago

have you found a way to solve this problem?

shayrybak commented 3 years ago

Did not, had to find other solutions. I think this project isn't maintained anymore.

pnthai88 commented 3 years ago

Did not, had to find other solutions. I think this project isn't maintained anymore.

I just gave up too.