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

Panic in CloseStream #36

Closed
cedws opened this issue Jun 12, 2024 · 3 comments
Closed

Panic in CloseStream #36

cedws opened this issue Jun 12, 2024 · 3 comments

Comments

@cedws
Copy link

cedws commented Jun 12, 2024

// CloseStream closes the stream. Once we’ve finished writing our client’s requests to the stream
// using client.StreamWrite or client.StreamWriteObject, we need to call client.CloseStream to let
// GreptimeDB know that we’ve finished writing and are expecting to receive a response.
func (c *Client) CloseStream(ctx context.Context) (*gpb.AffectedRows, error) {
resp, err := c.stream.CloseAndRecv()
if err != nil {
return nil, err
}
c.stream = nil
return resp.GetAffectedRows(), nil
}

CloseStream may attempt to use c.stream when it is nil, which happens if a stream has not previously been written to.

@evenyag
Copy link
Contributor

evenyag commented Jun 14, 2024

Thanks for your report, this should be a bug. Would you be interested in submitting a PR to fix it? @cedws

@cedws
Copy link
Author

cedws commented Jun 14, 2024

Sorry, I just wanted to try out Greptime. I probably won't spend time on this.

@evenyag evenyag mentioned this issue Jun 14, 2024
1 task
@evenyag
Copy link
Contributor

evenyag commented Jun 15, 2024

#37 should fix this.

@evenyag evenyag closed this as completed Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants