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 Table Api ignore timeout, when wrong host name is used #12423

Closed
leonbrag opened this issue Jul 7, 2020 · 8 comments
Closed

Azure Table Api ignore timeout, when wrong host name is used #12423

leonbrag opened this issue Jul 7, 2020 · 8 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. 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 Service Attention Workflow: This issue is responsible by Azure service team. Tables
Milestone

Comments

@leonbrag
Copy link

leonbrag commented Jul 7, 2020

  • Package Name:

azure-common==1.1.25
azure-core==1.6.0
azure-cosmos==4.0.0
azure-cosmosdb-nspkg==2.0.2
azure-cosmosdb-table==1.0.6
azure-nspkg==3.0.2

Windows 10

Python 3.7.3

Following code connect to the purposely wrong account:

table_service = TableService("WrongAccountHere", "Key", socket_timeout=3)
    try:
        
        retVal = table_service.insert_entity("IoT", blah, timeout = 3)
        print (f"inserted to Azure: {retVal}")

    except AzureException as e:
        print (e)
        return ({"Status": "error", "Error": str (e) })

Even though socket_timeout and timeout specified as 3 seconds, APIs takes a very long time to timeout (much more then 3 seconds)

Here is the error, as expected:

Client-Request-ID=793a5574-c098-11ea-af1e-705a0f42318f Retry policy did not allow for a retry: , HTTP status code=Unknown, Exception=HTTPSConnectionPool(host='wrongBlah.table.core.windows.net', port=443): Max retries exceeded with url: /IoT?timeout=3 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001A66BCA6518>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')).

Why are the timeout ignored?

@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 Jul 7, 2020
@kaerm kaerm added Client This issue points to a problem in the data-plane of the library. Tables labels Jul 8, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jul 8, 2020
@kaerm
Copy link
Contributor

kaerm commented Jul 8, 2020

@leonbrag thanks for reporting this, @annatisch can you take a look at this

@Petermarcu Petermarcu added the Service Attention Workflow: This issue is responsible by Azure service team. label Jul 22, 2020
@ghost
Copy link

ghost commented Jul 22, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @klaaslanghout.

@ghost
Copy link

ghost commented Jul 22, 2020

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @anfeldma-ms, @zfoster, @southpolesteve.

@annatisch
Copy link
Member

Thanks @leonbrag - we are working on a new SDK for Tables that is in development here:
https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/tables/azure-data-tables

@seankane-msft - we have a test to validate the socket timeout for the Blobs SDK, can you please add an equivalent test for the new Tables SDK?
https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/storage/azure-storage-blob/tests/test_blob_client.py#L195

Additionally an you confirm with the API reference documentation that timeout is a correct/support query parameter for this operation.

@seankane-msft
Copy link
Member

@leonbrag The query parameter you are looking for is actually called connection_timeout.

@seankane-msft
Copy link
Member

@leonbrag The new SDK for Tables was released in a preview state yesterday. It is available on pip with the command

pip install azure-data-tables

Your example would look like this with the new table

table_service = TableService("WrongAccountHere", "Key", socket_timeout=3)
    try:
        response = table_service.insert_entity(entity=entity, connection_timeout=3)
        print(f"inserted to Azure: {retVal}")
    except Exception as e:
        print(e)
        return ({"Status": "error", "Error": str(e)})

@seankane-msft
Copy link
Member

@leonbrag were you able to solve the issue?

@leonbrag
Copy link
Author

leonbrag commented Oct 7, 2020 via email

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. 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 Service Attention Workflow: This issue is responsible by Azure service team. Tables
Projects
None yet
Development

No branches or pull requests

6 participants