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

Deadlock when calling the code from an asp.net 4.8 web forms code behind #543

Closed
ronenfe opened this issue Mar 22, 2022 · 7 comments · Fixed by #545
Closed

Deadlock when calling the code from an asp.net 4.8 web forms code behind #543

ronenfe opened this issue Mar 22, 2022 · 7 comments · Fixed by #545
Labels
bug Something isn't working

Comments

@ronenfe
Copy link

ronenfe commented Mar 22, 2022

Describe the bug
Deadlock when calling the code from an asp.net 4.8 web forms code behind which is a synchronous code.

To Reproduce
Steps to reproduce the behavior:

  1. Create an asp.net web forms project
  2. Put following code in page_load event of a default.aspx page:
  3.  var content = new StringContent("..."
             , Encoding.UTF8, "application/json");
         var request = new HttpRequestMessage
         {
             Method = HttpMethod.Post,
             RequestUri = new Uri("..."),
             Content = content,
         };
         var credentials = new ImmutableCredentials("...", "...", null);
         var client = new HttpClient();
         var response = client.SendAsync(
           request: request,
           regionName: "...",
           serviceName: "execute-api",
           credentials: credentials).ConfigureAwait(false).GetAwaiter().GetResult();
    
  4. Code hangs

Expected behavior
Method should not hang

Environment (please complete the following information):

  • AWS service [AWS API Gateway]
  • OS: [Windows 10]
  • .NET version: [4.8]
@ronenfe ronenfe added the bug Something isn't working label Mar 22, 2022
@github-actions
Copy link
Contributor

Hi there and welcome to this repository!

A maintainer will be with you shortly, but first and foremost I would like to thank you for taking the time to report this issue. Quality is of the highest priority for us, and we would never release anything with known defects. We aim to do our best but unfortunately you are here because you encountered something we didn't expect. Lets see if we can figure out what went wrong and provide a remedy for it.

@FantasticFiasco
Copy link
Owner

Hi @ronenfe and thanks for reporting this.

A couple of questions helping me reproduce this:

  1. Is request targeting a recipient that is available on the network? I.e. should the request succeed but instead hangs?
  2. Does it hang forever or does it finally throw an exception?

@ronenfe
Copy link
Author

ronenfe commented Mar 23, 2022

Yes, this code works if I copy the signing code out of the nuget and put it inside my project and make all calls sync except the call for the original httpclient which I use for it .ConfigureAwait(false).GetAwaiter().GetResult() because it also doesn't have a sync send for .net 4.x Maybe adding another method for sync signing in the nuget will work. I did a pull request on the other nuget for aws singing which I was part of writing it, but the owner doesn't approve it because he thinks it's unsafe , maybe you want to implement it the same way. tsibelman/aws-signer-v4-dot-net#37 (comment)
The code never returns from the nuget, no exception, it just get hung.

@FantasticFiasco
Copy link
Owner

I've found the bug and will start working on fixing it in the upcoming days. Thanks for reporting it!

@FantasticFiasco
Copy link
Owner

This issue has now been fixed in v3.0.1. Thank you for reporting this issue!

@ronenfe
Copy link
Author

ronenfe commented Mar 29, 2022

Confirmed to work, thanks for the fast fix.

@ronenfe
Copy link
Author

ronenfe commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants