We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to reproduce:
package main import ( "context" "testing" "time" "github.com/alicebob/miniredis/v2" "github.com/go-redis/redis/v8" ) func TestXreadFromFirst(t *testing.T) { s := miniredis.RunT(t) defer s.Close() client := redis.NewClusterClient(&redis.ClusterOptions{ Addrs: []string{s.Addr()}, }) client.XRead(context.Background(), &redis.XReadArgs{ Streams: []string{"testStream", "0"}, Count: 1, Block: 100*time.Millisecond, }) } func TestXreadFromLast(t *testing.T) { s := miniredis.RunT(t) defer s.Close() client := redis.NewClusterClient(&redis.ClusterOptions{ Addrs: []string{s.Addr()}, }) client.XRead(context.Background(), &redis.XReadArgs{ Streams: []string{"testStream", "$"}, Count: 1, Block: 100*time.Millisecond, }) }
First case works as expected, but second fails with:
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0xdabe19] goroutine 22 [running]: github.com/alicebob/miniredis/v2.(*streamKey).lastID(0xc0000d0080?) <local-path>/github.com/alicebob/miniredis/v2@v2.30.0/stream.go:79 +0x39 github.com/alicebob/miniredis/v2.(*Miniredis).cmdXread(0xc0000d0080, 0xc0002e6140, {0xc0001344b7, 0x5}, {0xc00011c490, 0x7, 0x7}) <local-path>/github.com/alicebob/miniredis/v2@v2.30.0/cmd_stream.go:935 +0x76f github.com/alicebob/miniredis/v2/server.(*Server).Dispatch(0xc0003db400, 0x0?, {0xc00011c480, 0x8, 0x8}) <local-path>/github.com/alicebob/miniredis/v2@v2.30.0/server/server.go:217 +0x2ee github.com/alicebob/miniredis/v2/server.(*Server).servePeer(0x0?, {0x11a5268?, 0xc00048e008}) <local-path>/github.com/alicebob/miniredis/v2@v2.30.0/server/server.go:185 +0x3d1 github.com/alicebob/miniredis/v2/server.(*Server).ServeConn.func1() <local-path>/github.com/alicebob/miniredis/v2@v2.30.0/server/server.go:112 +0xb6 created by github.com/alicebob/miniredis/v2/server.(*Server).ServeConn <local-path>/github.com/alicebob/miniredis/v2@v2.30.0/server/server.go:108 +0x12a
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
Thanks, should be fixed now.
Successfully merging a pull request may close this issue.
How to reproduce:
First case works as expected, but second fails with:
The text was updated successfully, but these errors were encountered: