Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Remove Wait call to prevent deadlock #2534

Merged
merged 1 commit into from
Aug 30, 2016

Conversation

khellang
Copy link
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the Nancy code style guidelines
  • I have provided test coverage for my change (where applicable)

Description

The call to Task.Wait() causes a deadlock on many concurrent requests. This changes the method to do a synchronous copy instead.

Fixes #2533

@grumpydev
Copy link
Member

This would imply we have a task that's not CAF'd somewhere?

@jchannon
Copy link
Member

CAF'd?

@grumpydev
Copy link
Member

I was trying to not have to type ConfigureAwait(false) ;)

@khellang
Copy link
Member Author

This would imply we have a task that's not CAF'd somewhere?

Yes, probably. How do you track those down? It would be interesting if we found it and it fixed the problem.

@khellang
Copy link
Member Author

I think it might be time to look at #1920 again...

@grumpydev
Copy link
Member

There's this:

https://github.com/aelij/ConfigureAwaitChecker

But I'm not sure that can be run as a solution wide (or project wide) analysis.

@xt0rted
Copy link
Contributor

xt0rted commented Aug 11, 2016

A few months back I ran the ConfigureAwaitChecker on the project. The only thing that stood out to me was #2471

@jchannon
Copy link
Member

We merging this bad boy? @NancyFx/most-valued-minions

@thecodejunkie
Copy link
Member

@jchannon if we think that there is a stray ConfigureAwait(false) somewhere and that's the real cause, then I hope not

@xt0rted
Copy link
Contributor

xt0rted commented Aug 12, 2016

This might be worth setting up https://github.com/DotNetAnalyzers/AsyncUsageAnalyzers

One of the analyzers in there is for ConfigureAwait()

@jchannon
Copy link
Member

Go go go :)

On Friday, 12 August 2016, Brian Surowiec notifications@github.com wrote:

This might be worth setting up https://github.com/DotNetAnalyzers/
AsyncUsageAnalyzers


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2534 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAGapi4Ct_ZhDdwwKhiW0PxI1YEF_X23ks5qfKiKgaJpZM4JiByT
.

@jchannon
Copy link
Member

jchannon commented Aug 13, 2016

So I added this to Nancy's project.json and ran dotnet build but I get no warnings about async stuff. Is this all I have to do to enable the analyzers?

"AsyncUsageAnalyzers":{
     "version":"1.0.0-alpha003",
      "type":"build"
}

@thecodejunkie
Copy link
Member

@jchannon wouldn't that just let the compiler know it's a buildtime dependency? Wouldn't you have to tell something (Roslyn?) to use it to analyze the code ?

@jchannon
Copy link
Member

No idea I can't find any info on how to use these analysers on Google. I
found something on style cop but guess that's different. That says you have
to point to a rule set location but not sure these async ones have these

On Saturday, 13 August 2016, Andreas Håkansson notifications@github.com
wrote:

@jchannon https://github.com/jchannon wouldn't that just let the
compiler know it's a buildtime dependency? Wouldn't you have to tell
something (Roslyn?) to use it to analyze the code ?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2534 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAGapuCvQaTmKkGV-qeMD6VmA2LVe8Ixks5qfaC-gaJpZM4JiByT
.

@xt0rted
Copy link
Contributor

xt0rted commented Aug 13, 2016

It looks like there's no tooling to setup/configure code analysis when you use Nancy.Next.sln (unless it's been moved) but it's there when using Nancy.sln. I'm putting together a PR for this right now that sets some of it up.

@xt0rted xt0rted mentioned this pull request Aug 13, 2016
@jchannon
Copy link
Member

So are we confident after @xt0rted PRs etc that there is no CAF issue?

@jchannon
Copy link
Member

👀

@thecodejunkie thecodejunkie added this to the 2.0-clinteastwood milestone Aug 30, 2016
@thecodejunkie
Copy link
Member

@khellang could we update this please.. unsure if we should be merging or closing it? Thanks ❤️

@khellang
Copy link
Member Author

Update? I think this should be merged ASAP.

@thecodejunkie thecodejunkie merged commit ea703b8 into NancyFx:master Aug 30, 2016
@thecodejunkie
Copy link
Member

Done

@davidallyoung
Copy link
Contributor

@thecodejunkie @khellang I believe this pull request was overwritten during the merge of #2502 specifically by commit 6e46bc4 . Should I make a PR for the change that was intended by this pull request to prevent the deadlock? I discovered this while encountering a similar issue described by the OP in #2533 and wasn't sure why I was still experiencing it, but it looks like this PR was overwritten.

@khellang
Copy link
Member Author

Hmm. Yeah, that's really bad. No clue how that got past a code review 😕

@thecodejunkie
Copy link
Member

😢 @davidallyoung mind re-sending the fix?

@davidallyoung
Copy link
Contributor

Sure, I should be able to get it in this evening. @thecodejunkie

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

Successfully merging this pull request may close these issues.

None yet

6 participants