ClickHouse / clickhouse-go

Golang driver for ClickHouse
Apache License 2.0
2.82k stars 546 forks source link

Retry on network errors and fix retries on async inserts with `database/sql` interface #1330

Closed tommyzli closed 2 weeks ago

tommyzli commented 2 weeks ago

Summary

This PR fixes two issues with the database/sql interface

  1. The async insert code path is missing a check to signal a retry (by returning driver.ErrBadConn) if the connection is broken
  2. isConnBrokenError is to restrictive. The postgres driver marks all net.OpErrors as BadConns so I applied that here too

Checklist

Delete items not relevant to your PR:

CLAassistant commented 2 weeks ago

CLA assistant check
All committers have signed the CLA.