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

eventhub.NewHubWithNamespaceNameAndEnvironment blocks for more than 3 mins #180

Open
abhirockzz opened this issue Jun 15, 2020 · 1 comment

Comments

@abhirockzz
Copy link

Expected Behavior

Behavior of eventhub.NewHubWithNamespaceNameAndEnvironment should have sane defaults when invalid arguments (event hubs namespace and/or event hub name etc.) are passed i.e. timeout/fail in a reasonable amount of time

Or, it should allow the caller to enforce timeout by allowing it pass in a context.Context

Actual Behavior

I tried two scenarios:

  1. did not pass in valid event hubs namespace and/or event hub name (code was expecting it from env vars which I had missed and hence blank "" was passed in)
  2. did not pass in AAD env vars (AZURE_CLIENT_ID etc.) or SAS env vars

In both cases, I got the below error, but the app was stuck for ~3.5 mins

failed to create EH client neither Azure Active Directory nor SAS token provider could be built - AAD error
: failed to refersh token: &{{{  0 0 0  } 0x1668640 {{  <nil>    false  } {  <nil>    false  } {http  <nil> 169.254.169.254 /me
tadata/identity/oauth2/token  false api-version=2018-02-01&resource=https%3A%2F%2Feventhubs.azure.net%2F } {  <nil>    false  }
}  https://eventhubs.azure.net/ true 300000000000} 0xc0000c01a0 0xc00009d020 <nil> [] 5}, SAS error: unable to build SAS token 
provider because (EVENTHUB_KEY_NAME and EVENTHUB_KEY_VALUE) were empty, and EVENTHUB_CONNECTION_STRING was empty

Environment

  • OS: mac os
  • Go version: 1.14
  • Version of Library: 3.3.0
@catalinaperalta
Copy link
Member

Hi! Thanks for reaching out.

I haven't been able to reproduce this error. I created a simple example that only calls eventhub.NewHubWithNamespaceNameAndEnvironment and first did not set any environment variables and the error response returned was almost immediate. Then I set the vars you mentioned in your first scenario and the result was the same. I received the error response again almost immediately. Do you have code that could reproduce this problem so that I could test it out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants