Skip to content

Commit

Permalink
Attempt to read secondary error from info test (#1452)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
madolson authored Dec 18, 2024
1 parent 8060c86 commit 60197b3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/unit/info.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 60197b3

Please sign in to comment.