dotnet / orleans

Cloud Native application framework for .NET
https://docs.microsoft.com/dotnet/orleans
MIT License
10.07k stars 2.03k forks source link

The MembershipOracle not work with Npgsql 3.2.6 #3860

Closed ijsgaus closed 6 years ago

ijsgaus commented 6 years ago

When run silo MembershipOracle timeout after 5 min. With Npgsql 3.1.9 all work as expected. Expected behavior: Npgsql 3.1.9 Npgsql 3.1.10 Timeout on any Npgsql 3.2.*

veikkoeeva commented 6 years ago

@ijsgaus This might help: https://github.com/dotnet/orleans/pull/3163. There's some trouble to track down the XUnit serialization failure in the CI. Also for more context for Npgsql: https://github.com/dotnet/orleans/pull/2949#issuecomment-309160451.

sergeybykov commented 6 years ago

@ijsgaus Is there something in the logs beside timeouts?

PDarkTemplar commented 6 years ago

It is just locks, i have same problem #1130 last working version is 3.1.10 Npgsql remove all configureAwait(false) from async requests somewhere after 3.1.10

veikkoeeva commented 6 years ago

@ijsgaus, @PDarkTemplar Which version of the ADO.NET libraries are you running? Since there's a fix here that offloads the providers that have trouble into a new Task. This was there from the beginning for MySQL (it blocks in certain situations, not all) and then after this problem appeared, also Npgsql was offloaded.

PDarkTemplar commented 6 years ago

.NET framework 4.6.2 Orleans 1.5.4

sergeybykov commented 6 years ago

@veikkoeeva Are you saying that they just need to configure the related config values, and isSynchronousAdoNetImplementation will take care of offloading blocking calls?

veikkoeeva commented 6 years ago

@sergeybykov No need for configuration, Orleans marks Npgsql currently as blocking automatically regardless of version (here). Checking https://github.com/dotnet/orleans/pull/3164, the fix went in 1.5.0 and unblocked many PostgreSQL users as far as Gitter conversations were an indicator.

There is another problem (which is a problem I caused in some version by overly eagerly removing awaits) that #3163 should fix (as far as I understand the problem, but it's not certain it helps in this case). Though I have trouble finding out what is the actual problem there. The tests pass locally, but not on the CI (a serialization exception). I kind of a have a hunch (see links towards the end of the issue), albeit I'm afraid I need to wait for the weekend to troubleshoot in more depth.

sergeybykov commented 6 years ago

Looks like there isn't anything else we can do about the blocking issues with Npgsql beyond the mitigation that's already in place. I'll close it then. Feel free to reopen if I missed something.

PDarkTemplar commented 6 years ago

Just for heads up, all working fine on orleans 2.0 and .net core