blob: baeb04c41b0c125d76682b9424f01fee6d26c07a [file] [log] [blame]
Prevents dqlite db errors when system is under heavy I/O.
crbug.com/901108
--- a/dist/src/github.com/CanonicalLtd/go-dqlite/driver.go
+++ b/dist/src/github.com/CanonicalLtd/go-dqlite/driver.go
@@ -116,7 +116,7 @@
}
driver.clientConfig.Dial = o.Dial
- driver.clientConfig.AttemptTimeout = 5 * time.Second
+ driver.clientConfig.AttemptTimeout = 15 * time.Second
driver.clientConfig.RetryStrategies = []strategy.Strategy{
driverConnectionRetryStrategy(
o.ConnectionBackoffFactor,
@@ -358,7 +358,7 @@
// Commit the transaction.
func (tx *Tx) Commit() error {
// TODO: make the timeout configurable.
- ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
+ ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cancel()
if _, err := tx.conn.ExecContext(ctx, "COMMIT", nil); err != nil {
@@ -371,7 +371,7 @@
// Rollback the transaction.
func (tx *Tx) Rollback() error {
// TODO: make the timeout configurable.
- ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
+ ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cancel()
if _, err := tx.conn.ExecContext(ctx, "ROLLBACK", nil); err != nil {