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

The ReturnMessageQueue/Rowsq implementation needs tweaks to message ordering #720

Closed
shueybubbles opened this issue Feb 26, 2022 · 1 comment

Comments

@shueybubbles
Copy link
Contributor

active := true

The message queue example illustrates that the application waits for the first MsgNext event before calling Rows.Next.

Today, ProcessQueryResponse doesn't post a MsgNext event until the reader encounters column metadata. However, the reader channel only has a 5 token buffer, so if there are 5 tokens in the queue before it reaches any columns, the query blocks. Posting MsgNext right away will nudge the app to read tokens in the channel.

Exposed by a sqlcmd issue microsoft/go-sqlcmd#48

@shueybubbles
Copy link
Contributor Author

My earlier assertion about MsgNext isn't quite right.
We need to send MsgNextResult for every type of doneStruct and MsgNext for every column set.
We're also missing handling of ServerError and doneInProcStruct

This fix will also address microsoft/go-sqlcmd#47

@shueybubbles shueybubbles changed the title The ReturnMessageQueue/Rowsq implementation needs to post MsgNext during QueryContext The ReturnMessageQueue/Rowsq implementation needs tweaks to message ordering Feb 28, 2022
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

1 participant