Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

Commit efb2833

Browse filesBrowse files
fix: configure keepAlive time for gRPC TCP connections (#1448)
* fix: configure keepAlive time for gRPC TCP connections * fix tests * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix tests * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix flaky abort retry error * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update owlbot to persist the changes * fix owlbot --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 8818c30 commit efb2833
Copy full SHA for efb2833

11 files changed

+73-4Lines changed: 73 additions & 4 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc.py‎

Copy file name to clipboardExpand all lines: google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ def __init__(
276276
options=[
277277
("grpc.max_send_message_length", -1),
278278
("grpc.max_receive_message_length", -1),
279+
("grpc.keepalive_time_ms", 120000),
279280
],
280281
)
281282

Collapse file

‎google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc_asyncio.py‎

Copy file name to clipboardExpand all lines: google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc_asyncio.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ def __init__(
325325
options=[
326326
("grpc.max_send_message_length", -1),
327327
("grpc.max_receive_message_length", -1),
328+
("grpc.keepalive_time_ms", 120000),
328329
],
329330
)
330331

Collapse file

‎google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc.py‎

Copy file name to clipboardExpand all lines: google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ def __init__(
285285
options=[
286286
("grpc.max_send_message_length", -1),
287287
("grpc.max_receive_message_length", -1),
288+
("grpc.keepalive_time_ms", 120000),
288289
],
289290
)
290291

Collapse file

‎google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc_asyncio.py‎

Copy file name to clipboardExpand all lines: google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc_asyncio.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ def __init__(
334334
options=[
335335
("grpc.max_send_message_length", -1),
336336
("grpc.max_receive_message_length", -1),
337+
("grpc.keepalive_time_ms", 120000),
337338
],
338339
)
339340

Collapse file

‎google/cloud/spanner_v1/services/spanner/transports/grpc.py‎

Copy file name to clipboardExpand all lines: google/cloud/spanner_v1/services/spanner/transports/grpc.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ def __init__(
267267
options=[
268268
("grpc.max_send_message_length", -1),
269269
("grpc.max_receive_message_length", -1),
270+
("grpc.keepalive_time_ms", 120000),
270271
],
271272
)
272273

Collapse file

‎google/cloud/spanner_v1/services/spanner/transports/grpc_asyncio.py‎

Copy file name to clipboardExpand all lines: google/cloud/spanner_v1/services/spanner/transports/grpc_asyncio.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ def __init__(
315315
options=[
316316
("grpc.max_send_message_length", -1),
317317
("grpc.max_receive_message_length", -1),
318+
("grpc.keepalive_time_ms", 120000),
318319
],
319320
)
320321

Collapse file

‎owlbot.py‎

Copy file name to clipboardExpand all lines: owlbot.py
+47Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from pathlib import Path
1818
import shutil
1919
from typing import List, Optional
20+
import re
2021

2122
import synthtool as s
2223
from synthtool import gcp
@@ -185,6 +186,22 @@ def get_staging_dirs(
185186
)"""
186187
)
187188

189+
count = s.replace(
190+
[
191+
library / "google/cloud/spanner_v1/services/*/transports/grpc*",
192+
library / "tests/unit/gapic/spanner_v1/*",
193+
],
194+
"^\s+options=\\[.*?\\]",
195+
"""options=[
196+
("grpc.max_send_message_length", -1),
197+
("grpc.max_receive_message_length", -1),
198+
("grpc.keepalive_time_ms", 120000),
199+
]""",
200+
flags=re.MULTILINE | re.DOTALL,
201+
)
202+
if count < 1:
203+
raise Exception("Expected replacements for gRPC channel options not made.")
204+
188205
s.move(
189206
library,
190207
excludes=[
@@ -201,6 +218,21 @@ def get_staging_dirs(
201218
for library in get_staging_dirs(
202219
spanner_admin_instance_default_version, "spanner_admin_instance"
203220
):
221+
count = s.replace(
222+
[
223+
library / "google/cloud/spanner_admin_instance_v1/services/*/transports/grpc*",
224+
library / "tests/unit/gapic/spanner_admin_instance_v1/*",
225+
],
226+
"^\s+options=\\[.*?\\]",
227+
"""options=[
228+
("grpc.max_send_message_length", -1),
229+
("grpc.max_receive_message_length", -1),
230+
("grpc.keepalive_time_ms", 120000),
231+
]""",
232+
flags=re.MULTILINE | re.DOTALL,
233+
)
234+
if count < 1:
235+
raise Exception("Expected replacements for gRPC channel options not made.")
204236
s.move(
205237
library,
206238
excludes=["google/cloud/spanner_admin_instance/**", "*.*", "docs/index.rst", "noxfile.py", "**/gapic_version.py", "testing/constraints-3.7.txt",],
@@ -209,6 +241,21 @@ def get_staging_dirs(
209241
for library in get_staging_dirs(
210242
spanner_admin_database_default_version, "spanner_admin_database"
211243
):
244+
count = s.replace(
245+
[
246+
library / "google/cloud/spanner_admin_database_v1/services/*/transports/grpc*",
247+
library / "tests/unit/gapic/spanner_admin_database_v1/*",
248+
],
249+
"^\s+options=\\[.*?\\]",
250+
"""options=[
251+
("grpc.max_send_message_length", -1),
252+
("grpc.max_receive_message_length", -1),
253+
("grpc.keepalive_time_ms", 120000),
254+
]""",
255+
flags=re.MULTILINE | re.DOTALL,
256+
)
257+
if count < 1:
258+
raise Exception("Expected replacements for gRPC channel options not made.")
212259
s.move(
213260
library,
214261
excludes=["google/cloud/spanner_admin_database/**", "*.*", "docs/index.rst", "noxfile.py", "**/gapic_version.py", "testing/constraints-3.7.txt",],
Collapse file

‎tests/unit/gapic/spanner_admin_database_v1/test_database_admin.py‎

Copy file name to clipboardExpand all lines: tests/unit/gapic/spanner_admin_database_v1/test_database_admin.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,7 @@ def test_database_admin_client_create_channel_credentials_file(
11361136
options=[
11371137
("grpc.max_send_message_length", -1),
11381138
("grpc.max_receive_message_length", -1),
1139+
("grpc.keepalive_time_ms", 120000),
11391140
],
11401141
)
11411142

@@ -23315,6 +23316,7 @@ def test_database_admin_transport_create_channel(transport_class, grpc_helpers):
2331523316
options=[
2331623317
("grpc.max_send_message_length", -1),
2331723318
("grpc.max_receive_message_length", -1),
23319+
("grpc.keepalive_time_ms", 120000),
2331823320
],
2331923321
)
2332023322

@@ -23347,6 +23349,7 @@ def test_database_admin_grpc_transport_client_cert_source_for_mtls(transport_cla
2334723349
options=[
2334823350
("grpc.max_send_message_length", -1),
2334923351
("grpc.max_receive_message_length", -1),
23352+
("grpc.keepalive_time_ms", 120000),
2335023353
],
2335123354
)
2335223355

@@ -23593,6 +23596,7 @@ def test_database_admin_transport_channel_mtls_with_client_cert_source(transport
2359323596
options=[
2359423597
("grpc.max_send_message_length", -1),
2359523598
("grpc.max_receive_message_length", -1),
23599+
("grpc.keepalive_time_ms", 120000),
2359623600
],
2359723601
)
2359823602
assert transport.grpc_channel == mock_grpc_channel
@@ -23640,6 +23644,7 @@ def test_database_admin_transport_channel_mtls_with_adc(transport_class):
2364023644
options=[
2364123645
("grpc.max_send_message_length", -1),
2364223646
("grpc.max_receive_message_length", -1),
23647+
("grpc.keepalive_time_ms", 120000),
2364323648
],
2364423649
)
2364523650
assert transport.grpc_channel == mock_grpc_channel
Collapse file

‎tests/unit/gapic/spanner_admin_instance_v1/test_instance_admin.py‎

Copy file name to clipboardExpand all lines: tests/unit/gapic/spanner_admin_instance_v1/test_instance_admin.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,7 @@ def test_instance_admin_client_create_channel_credentials_file(
11251125
options=[
11261126
("grpc.max_send_message_length", -1),
11271127
("grpc.max_receive_message_length", -1),
1128+
("grpc.keepalive_time_ms", 120000),
11281129
],
11291130
)
11301131

@@ -18621,6 +18622,7 @@ def test_instance_admin_transport_create_channel(transport_class, grpc_helpers):
1862118622
options=[
1862218623
("grpc.max_send_message_length", -1),
1862318624
("grpc.max_receive_message_length", -1),
18625+
("grpc.keepalive_time_ms", 120000),
1862418626
],
1862518627
)
1862618628

@@ -18653,6 +18655,7 @@ def test_instance_admin_grpc_transport_client_cert_source_for_mtls(transport_cla
1865318655
options=[
1865418656
("grpc.max_send_message_length", -1),
1865518657
("grpc.max_receive_message_length", -1),
18658+
("grpc.keepalive_time_ms", 120000),
1865618659
],
1865718660
)
1865818661

@@ -18881,6 +18884,7 @@ def test_instance_admin_transport_channel_mtls_with_client_cert_source(transport
1888118884
options=[
1888218885
("grpc.max_send_message_length", -1),
1888318886
("grpc.max_receive_message_length", -1),
18887+
("grpc.keepalive_time_ms", 120000),
1888418888
],
1888518889
)
1888618890
assert transport.grpc_channel == mock_grpc_channel
@@ -18928,6 +18932,7 @@ def test_instance_admin_transport_channel_mtls_with_adc(transport_class):
1892818932
options=[
1892918933
("grpc.max_send_message_length", -1),
1893018934
("grpc.max_receive_message_length", -1),
18935+
("grpc.keepalive_time_ms", 120000),
1893118936
],
1893218937
)
1893318938
assert transport.grpc_channel == mock_grpc_channel
Collapse file

‎tests/unit/gapic/spanner_v1/test_spanner.py‎

Copy file name to clipboardExpand all lines: tests/unit/gapic/spanner_v1/test_spanner.py
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,7 @@ def test_spanner_client_create_channel_credentials_file(
10661066
options=[
10671067
("grpc.max_send_message_length", -1),
10681068
("grpc.max_receive_message_length", -1),
1069+
("grpc.keepalive_time_ms", 120000),
10691070
],
10701071
)
10711072

@@ -12180,6 +12181,7 @@ def test_spanner_transport_create_channel(transport_class, grpc_helpers):
1218012181
options=[
1218112182
("grpc.max_send_message_length", -1),
1218212183
("grpc.max_receive_message_length", -1),
12184+
("grpc.keepalive_time_ms", 120000),
1218312185
],
1218412186
)
1218512187

@@ -12209,6 +12211,7 @@ def test_spanner_grpc_transport_client_cert_source_for_mtls(transport_class):
1220912211
options=[
1221012212
("grpc.max_send_message_length", -1),
1221112213
("grpc.max_receive_message_length", -1),
12214+
("grpc.keepalive_time_ms", 120000),
1221212215
],
1221312216
)
1221412217

@@ -12419,6 +12422,7 @@ def test_spanner_transport_channel_mtls_with_client_cert_source(transport_class)
1241912422
options=[
1242012423
("grpc.max_send_message_length", -1),
1242112424
("grpc.max_receive_message_length", -1),
12425+
("grpc.keepalive_time_ms", 120000),
1242212426
],
1242312427
)
1242412428
assert transport.grpc_channel == mock_grpc_channel
@@ -12463,6 +12467,7 @@ def test_spanner_transport_channel_mtls_with_adc(transport_class):
1246312467
options=[
1246412468
("grpc.max_send_message_length", -1),
1246512469
("grpc.max_receive_message_length", -1),
12470+
("grpc.keepalive_time_ms", 120000),
1246612471
],
1246712472
)
1246812473
assert transport.grpc_channel == mock_grpc_channel

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.