Skip to content
This repository was archived by the owner on Aug 25, 2026. It is now read-only.
This repository was archived by the owner on Aug 25, 2026. It is now read-only.

Missing default deadlines in generated stubs #1477

Closed

Description

@igorbernstein2

Code example

from google.cloud.bigtable_admin_v2 import BigtableTableAdminClient
from google.cloud.bigtable_admin_v2.types import ModifyColumnFamiliesRequest, ColumnFamily,GcRule

c = BigtableTableAdminClient()
c.modify_column_families(
    ModifyColumnFamiliesRequest(
        name="projects/my-project/instances/my-instance/tables/my-table",
        modifications=[
            ModifyColumnFamiliesRequest.Modification(
                id="family",
                create=ColumnFamily(
                    gc_rule=GcRule(
                        max_num_versions=1
                    )
                )
            )
        ]
    )
)

This should send the RPC using the default deadline configured here in service json file, which generates the defaults base.py:
https://github.com/googleapis/python-bigtable/blob/0841824c7b9539df2530370ea128c140eda0f2b2/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/base.py#L199-L203

However this deadline is not respected. I believe the problem comes from the generator using None as the default in the stub:

https://github.com/googleapis/python-bigtable/blob/0841824c7b9539df2530370ea128c140eda0f2b2/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/client.py#L1229

Which will end up being pushed down into determine_timeout:
https://github.com/googleapis/python-api-core/blob/ddcc2499fa756f98268eb552edba6f25ddbe0c26/google/api_core/gapic_v1/method.py#L63-L101

Which seems to treat None to mean no deadline and wants Method.DEFAULT to mean the default deadline

Specifically this:

   if specified_timeout is DEFAULT:
        specified_timeout = default_timeout

This effectively means that gapic generated clients will never send a default deadline

Activity

  1. vam-google commented on Oct 20, 2022

    @vam-google
    Contributor

    Hi Igor,
    The retry, polling and timeotus are in a bad shape in python libraries and we are actively working on cleaning all that up. The default timeout=None is a known issue and is going to be addressed soon in gapic-genertor-python PR, which first needs this big PR be submitted: googleapis/python-api-core#462.

    I.e. the issue is much more fundamental bug we are right in the process of fixing it (and also the terminology used is broken)

  2. added a commit that references this issue on Oct 27, 2022
  3. added a commit that references this issue on Dec 5, 2022
  4. added a commit that references this issue on Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions