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

contrib/database/sql.tracedConn doesn't implement driver.SessionResetter #908

Merged
merged 2 commits into from
Apr 20, 2021

Conversation

kyfk
Copy link
Contributor

@kyfk kyfk commented Apr 20, 2021

There was an issue with go-mysql-driver that a connection returns an error "invalid connection."
article: https://github.blog/2020-05-20-three-bugs-in-the-go-mysql-driver/

And the author of the article fixed it go-sql-driver/mysql#934.

If driver.SessionResetter is implemented, returns ErrBadConn instead of ErrInvalidConn, then it retries to establish a new connection again.

So I added ResetSession to tracedConn to avoid the error occurring.

@gbbr
Copy link
Contributor

gbbr commented Apr 20, 2021

Thanks for this.

@gbbr gbbr added this to the 1.30.0 milestone Apr 20, 2021
@kyfk
Copy link
Contributor Author

kyfk commented Apr 20, 2021

@gbbr Thank you for your reviews. I fixed all the point you mentioned.
Plz review again 🙏

@gbbr gbbr merged commit a27900a into DataDog:v1 Apr 20, 2021
@gbbr
Copy link
Contributor

gbbr commented Apr 20, 2021

Thanks!

stlimtat pushed a commit to stlimtat/dd-trace-go that referenced this pull request May 17, 2021
* 'v1' of https://github.com/DataDog/dd-trace-go:
  Implement DD_PROFILING_OUTPUT_DIR for dev/debug (DataDog#924)
  contrib/go-pg/pg.v10: add INTEGRATION flag check for tests (DataDog#921)
  contrib/go-redis/redis.v8: optimize BeforeProcess and BeforeProcessPipeline (DataDog#920)
  CI: check go.sum is up-to-date (DataDog#918)
  README: Fix go get instructions (DataDog#913)
  internal/log: Improve API for testing (DataDog#916)
  ddtrace/tracer: add support for agent discovery endpoint, feature flags, stats & drops (DataDog#859)
  internal/version: bump to v1.31.0 (DataDog#910)
  CONTRIBUTING.md: add link to contrib/README.md (DataDog#802)
  profiler: Disable agentless mode for WithAPIKey (DataDog#906)
  contrib/Shopify/sarama: fix possible deadlock in WrapAsyncProducer (DataDog#907)
  contrib/database/sql.tracedConn implement driver.SessionResetter (DataDog#908)
  ddtrace/opentracer: consider FollowsFrom references as children (DataDog#905)
  ddtrace/opentracer: add support for opentracing.TracerContextWithSpanExtension (DataDog#855)
  ddtrace/tracer: follow noDebugStack setting when using SetTag with an error (DataDog#900)
  contrib/net/http: add a getter to retrieve original round tripper (DataDog#903)
  ddtrace/tracer: ensure Flush call is synchronous (DataDog#901)
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

Successfully merging this pull request may close these issues.

None yet

2 participants