• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

go-sql-driver / mysql / 1873
83%

Build:
DEFAULT BRANCH: master
Ran 12 May 2020 04:18AM UTC
Jobs 10
Files 17
Run time 14min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

12 May 2020 04:12AM UTC coverage: 81.672% (+0.02%) from 81.656%
1873

push

travis-ci-com

web-flow
Fix checking cancelled connections back into the connection pool (#1095)

If
    * BeginTx is called with a non-default isolation level,
    * The context is canceled before SET TRANSACTION ISOLATION LEVEL
    completes,
then the connection:
    * has the cancelled property set to "context cancelled",
    * has the closed property set to true,
and,
    * BeginTx returns "context canceled"

Because of this, the connection gets put back into the connection pool.
When it is checked out again, if BeginTx is called on it again _without_
an isolation level,
    * then we fall into the mc.closed.IsSet() check in begin(),
    * so we return ErrBadConn,
    * so the driver kicks the broken connection out of the pool
    * (and transparently retries to get a new connection that isn't
    broken too).

However, if BeginTx is called on the connection _with_ an isolation
level, then we return a context canceled error from the SET TRANSACTION
ISOLATION LEVEL call.

That means the broken connection will stick around in the pool forever
(or until it's checked out for some other operation that correctly
returns ErrBadConn).

The fix is to check for the connection being closed before executing SET
TRANSACTION ISOLATION LEVEL.

2794 of 3421 relevant lines covered (81.67%)

578250.44 hits per line

Jobs
ID Job ID Ran Files Coverage
1 1873.1 12 May 2020 04:18AM UTC 0
81.15
Travis Job 1873.1
2 1873.2 12 May 2020 04:18AM UTC 0
81.15
Travis Job 1873.2
3 1873.3 12 May 2020 04:20AM UTC 0
81.15
Travis Job 1873.3
4 1873.4 12 May 2020 04:20AM UTC 0
81.15
Travis Job 1873.4
5 1873.5 (DB=MYSQL8) 12 May 2020 04:18AM UTC 0
81.53
Travis Job 1873.5
6 1873.6 (DB=MYSQL57) 12 May 2020 04:25AM UTC 0
81.47
Travis Job 1873.6
7 1873.7 (DB=MARIA55) 12 May 2020 04:24AM UTC 0
80.94
Travis Job 1873.7
8 1873.8 (DB=MARIA10_1) 12 May 2020 04:25AM UTC 0
81.29
Travis Job 1873.8
9 1873.9 12 May 2020 04:33AM UTC 0
81.44
Travis Job 1873.9
10 1873.10 12 May 2020 04:30AM UTC 0
81.15
Travis Job 1873.10
Source Files on build 1873
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #1873
  • 6313f20f on github
  • Prev Build on master (#1870)
  • Next Build on master (#1878)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc