Attempt to read secondary error from info test (#1452)

The test attempts to write 1MB of data in order to trigger a disconnect.
Normally, the data is fully flushed and we get the error on the read
(I/O error). However, it's possible we might fail the write, which
leaves the client in an inconsistent state. On the next command, we
finally process the I/O error on the FD. So, the simple fix is to
consume any secondary errors.

---------

Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
This commit is contained in:
Madelyn Olson 2024-12-18 09:17:11 -08:00 committed by GitHub
parent 8060c86d20
commit 60197b30e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -391,7 +391,13 @@ start_server {tags {"info" "external:skip" "debug_defrag:skip"}} {
# set qbuf limit to minimum to test stat
set org_qbuf_limit [lindex [r config get client-query-buffer-limit] 1]
r config set client-query-buffer-limit 1048576
catch {r set key [string repeat a 1048576]}
catch {r set key [string repeat a 2048576]} e
# We might get an error on the write path of the previous command, which won't be
# an I/O error based on how the client is designed. We will need to manually consume
# the secondary I/O error.
if {![string match "I/O error*" $e]} {
catch {r read}
}
set info [r info stats]
assert_equal [getInfoProperty $info client_query_buffer_limit_disconnections] {1}
r config set client-query-buffer-limit $org_qbuf_limit