Skip to content
New issue

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

Unable to use stream with STREAM_ID > 127 #223

Closed
oleg-jukovec opened this issue Oct 19, 2022 · 0 comments · Fixed by #224
Closed

Unable to use stream with STREAM_ID > 127 #223

oleg-jukovec opened this issue Oct 19, 2022 · 0 comments · Fixed by #224
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@oleg-jukovec
Copy link
Collaborator

oleg-jukovec commented Oct 19, 2022

Reproducer:

func TestNewStream_Many(t *testing.T) {
	test_helpers.SkipIfStreamsUnsupported(t)

	conn := test_helpers.ConnectWithValidation(t, server, opts)
	defer conn.Close()

	for i := 0; i < 256; i++ {
		stream, _ := conn.NewStream()

		req := NewPingRequest()

		_, err := stream.Do(req).Get()
		if err != nil {
			t.Fatalf("Failed to Ping: %s", err.Error())
		}
	}
}

Result:

Failed to Ping: Invalid MsgPack - packet header (0x14)

Most likely the reason is an incorrect conversion to bytes of a stream id value:

hBytes = append(hBytes, KeyStreamId, byte(streamId))

You can compare it with the code above:

go-tarantool/connection.go

Lines 544 to 546 in 8b58928

KeySync, 0xce,
byte(reqid >> 24), byte(reqid >> 16),
byte(reqid >> 8), byte(reqid),

@oleg-jukovec oleg-jukovec added bug Something isn't working 1sp good first issue Good for newcomers labels Oct 19, 2022
oleg-jukovec added a commit that referenced this issue Oct 19, 2022
The patch fixes an error if a stream id value > 127:

Invalid MsgPack - packet header (0x14)

Closes #223
oleg-jukovec added a commit that referenced this issue Oct 19, 2022
The patch fixes an error if a stream id value > 127:

Invalid MsgPack - packet header (0x14)

Closes #223
oleg-jukovec added a commit that referenced this issue Oct 19, 2022
The patch fixes an error if a stream id value > 127:

Invalid MsgPack - packet header (0x14)

Closes #223
oleg-jukovec added a commit that referenced this issue Oct 19, 2022
The patch fixes an error if a stream id value > 127:

Invalid MsgPack - packet header (0x14)

Closes #223
oleg-jukovec added a commit that referenced this issue Oct 19, 2022
The patch fixes an error if a stream id value > 127:

Invalid MsgPack - packet header (0x14)

Closes #223
@oleg-jukovec oleg-jukovec self-assigned this Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant