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

conn: fix Close() on rows when a timeout during processing #548

Merged
merged 1 commit into from
May 3, 2022

Commits on Apr 22, 2022

  1. conn: fix Close() on rows when a timeout during processing

    There is a race condition when calling rows.Close() after a query was
    stopped due to an error (notably when hitting a timeout). The
    goroutine processing the query result tries to send the error to the
    error channel, before closing both the error and the stream channel
    while the Close() method is trying to read from stream before
    processing errors. This leads to a deadlock.
    
    This could be fixed by closing the stream channel before sending the
    error, but it seems more future-proof to drain both stream and errors
    channel in parallel in the Close() method.
    vincentbernat committed Apr 22, 2022
    Configuration menu
    Copy the full SHA
    2b7b2c2 View commit details
    Browse the repository at this point in the history