2020-09-09 16:01:16 +03:00
|
|
|
# source tests/support/util.tcl
|
|
|
|
|
|
|
|
set testmodule [file normalize tests/modules/blockedclient.so]
|
|
|
|
|
|
|
|
start_server {tags {"modules"}} {
|
|
|
|
r module load $testmodule
|
|
|
|
|
|
|
|
test {Locked GIL acquisition} {
|
|
|
|
assert_match "OK" [r acquire_gil]
|
|
|
|
}
|
2020-10-11 17:21:58 +03:00
|
|
|
|
|
|
|
test {Locked GIL acquisition during multi} {
|
|
|
|
r multi
|
|
|
|
r acquire_gil
|
|
|
|
assert_equal {{Blocked client is not supported inside multi}} [r exec]
|
|
|
|
}
|
2020-12-08 16:41:20 +02:00
|
|
|
|
|
|
|
test {blocked client reaches client output buffer limit} {
|
|
|
|
r hset hash big [string repeat x 50000]
|
|
|
|
r hset hash bada [string repeat x 50000]
|
|
|
|
r hset hash boom [string repeat x 50000]
|
|
|
|
r config set client-output-buffer-limit {normal 100000 0 0}
|
|
|
|
r client setname myclient
|
|
|
|
catch {r do_bg_rm_call hgetall hash} e
|
|
|
|
assert_match "*I/O error*" $e
|
|
|
|
reconnect
|
|
|
|
set clients [r client list]
|
|
|
|
assert_no_match "*name=myclient*" $clients
|
|
|
|
}
|
2020-09-09 16:01:16 +03:00
|
|
|
}
|