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

Fix "cannot start a transaction within a transaction" issue (#764) #765

Merged
merged 2 commits into from Aug 28, 2020

Commits on Feb 25, 2020

  1. Fix "cannot start a transaction within a transaction" issue

    [why]
    If db.BeginTx(ctx, nil) context is cancelled too fast, "BEGIN" statement can be
    completed inside DB, but we still try to cancel it with sqlite3_interrupt.
    In such case we get context.Cancelled or context.DeadlineExceeded from exec(),
    but operation really completed. Connection returned into pool, and returns "cannot
    start a transaction within a transaction" error for next db.BeginTx() call.
    
    [how]
    Handle status code returned from cancelled operation.
    
    [testing]
    Added unit-test which reproduces issue.
    azavorotnii committed Feb 25, 2020
    Copy the full SHA
    c5807c9 View commit details
    Browse the repository at this point in the history
  2. Reduce TestQueryRowContextCancelParallel concurrency

    [why]
    Tests times out in travis-ci when run with -race option.
    azavorotnii committed Feb 25, 2020
    Copy the full SHA
    5c1abba View commit details
    Browse the repository at this point in the history