spanner: increase the timeout in session preparation
Periodically, DeadlineExceeded errors are reported in logs. But
there seems to be no affect on performance and the errors are
unactionable. The current timeout is very short (1 second), so
we should consider to increase it.
Fixes #1657.
Change-Id: Ie6624795dccfc58877bbb1b5d1d7b688ad346b42
Reviewed-on: https://code-review.googlesource.com/c/gocloud/+/49830
Reviewed-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Knut Olav Løite <koloite@gmail.com>
diff --git a/spanner/session.go b/spanner/session.go
index 7fc0265..573a008 100644
--- a/spanner/session.go
+++ b/spanner/session.go
@@ -1187,7 +1187,7 @@
}
ws := getNextForTx()
if ws != nil {
- ctx, cancel := context.WithTimeout(context.Background(), time.Second)
+ ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
err := ws.prepareForWrite(ctx)
cancel()
if err != nil {