Skip to content

aiplatform_v1.ModelGardenServiceClient gets stuck on first initialization when done concurrently #2805

@tmyjoe

Description

@tmyjoe

When initializing the aiplatform_v1.ModelGardenServiceClient class concurrently, we've encountered an issue where it gets stuck.

Upon further investigation, it stops at the following line where a GRPC channel is created in ModelGardenServiceGrpcTransport,

Following this further leads to where the cygrpc.Channel is created, where it appears that both threads stop.
https://github.com/grpc/grpc/blob/master/src/python/grpcio/grpc/_channel.py#L1973

Once initialization is successful for the first time without this issue, subsequent processes proceed without any problems even when done concurrently, suggesting that this issue only occurs on the first attempt.

Environment details

  • OS type and version: macOS 12.6.6
  • Python version: 3.10.9
  • pip version: 23.2.1
  • google-cloud-aiplatform version: 1.35.0

Steps to reproduce

  1. aiplatform_v1.ModelGardenServiceClient concurrently

Code example

here is the code to reproduce issue.

# example

from google.cloud import aiplatform_v1
from concurrent.futures import ThreadPoolExecutor

def init_model_gardern_service_client(_):
    # Create a client
    client = aiplatform_v1.ModelGardenServiceClient()

def parallel_execution():
    with ThreadPoolExecutor() as executor:
        results = list(executor.map(init_model_gardern_service_client, [None]*2))

if __name__ == "__main__":
    parallel_execution()

Stack trace

There is no stacktrace as the process gets just stuck.

Metadata

Metadata

Assignees

Labels

api: vertex-aiIssues related to the googleapis/python-aiplatform API.externalThis issue is blocked on a bug with the actual product.needs more infoThis issue needs more information from the customer to proceed.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions