Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azure-cosmos not able to disable "endpoint_discovery" #21750

Closed
gavinHuang opened this issue Nov 15, 2021 · 3 comments
Closed

azure-cosmos not able to disable "endpoint_discovery" #21750

gavinHuang opened this issue Nov 15, 2021 · 3 comments
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. Cosmos customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team

Comments

@gavinHuang
Copy link

  • Package Name: Azure-cosmos
  • Package Version: 4.2.0 (and all other version)
  • Operating System:Windows
  • Python Version: 3.7

Describe the bug
"enable_endpoint_discovery" can't set to False at Cosmos_Client.py (line 82):
policy.EnableEndpointDiscovery = kwargs.pop('enable_endpoint_discovery', None) or policy.EnableEndpointDiscovery
Even specifically set the value to False, this code will alway use the default value which is True.

To Reproduce
Steps to reproduce the behavior:
1.
cosmos_client = CosmosClient( url="https://accountname.documents.azure.com:443", credential="account_key", enable_endpoint_discovery=False )

Expected behavior
Disable endpoint discovery

Screenshots

Additional context
I don't need account discovery, the discovery change the url to something like:
accountname-[region_name].documents.azure.com
which in my environment is not a valid domain name, so I get error:
azure.core.exceptions.ServiceRequestError: <urllib3.connection.HTTPSConnection object at 0x0000029C0E3B0588>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 15, 2021
@swathipil swathipil added bug This issue requires a change to an existing behavior in the product in order to be resolved. Cosmos CXP Attention and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 16, 2021
@ghost ghost added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Nov 16, 2021
@swathipil swathipil added the Client This issue points to a problem in the data-plane of the library. label Nov 16, 2021
@swathipil
Copy link
Member

@gavinHuang Thanks for the feedback - directing this to the right people!

@simorenoh
Copy link
Member

Hi @gavinHuang, thank you for reporting this. You are completely right, this is a current gap in the SDK; the line you outlined will always evaluate to True since the second condition (policy.EnableEndpointDiscovery) is set to True (and naturally any or statement with one True condition ends up being True).

I have gone ahead and fixed this here: #21778

Thanks again for reporting this and helping us improve the SDK! :)

@gavinHuang
Copy link
Author

Thanks for the quick turn around!

@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. Cosmos customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team
Projects
None yet
Development

No branches or pull requests

4 participants