Giter Site home page Giter Site logo

Comments (4)

shaan1337 avatar shaan1337 commented on May 29, 2024

Progress updates:

  • Managed to consistently reproduce the issue on Ubuntu 18.04 by adding GRPC_TRACE=all and GRPC_VERBOSITY=debug to the environment which slows down the execution and makes the issue much more likely to occur. To analyze the grpc traces, I also had to redirect standard output and standard error to a file with a dup2 system call but not sure it's a necessary condition to make the issue reproducible.

  • Only a single iteration of the test is required to reproduce the issue (instead of 50 in the test)

  • Analyzing the backtraces with lldb shows that the mono Finalizer thread is waiting on a futex. I'm not 100% sure this is the cause but it's very likely given the information below - the Dispose calls are probably being done by the Finalizer thread. The fact that the test successfully passes and then the hanging occurs also supports this hypothesis.

  • The issue occurs when we call Dispose() on AsyncDuplexStreamingCall - it seems that it's currently in use only with persistent subscriptions.

  • Removing _call?.Dispose(); here stops the hanging:

  • It is also related to the dispose calls on the AsyncDuplexStreamingCall in the interceptors - replacing any of the response.Dispose calls with an empty action stops the hanging:

    response.GetStatus, response.GetTrailers, response.Dispose);

Summary:

It appears that multiple simultaneous calls to Dispose() on AsyncDuplexStreamingCall causes a deadlock due to a race condition.

I've attempted a minimal reproduction (without EventStore-specific code) but I've been unsuccessful so far.

from eventstore-client-dotnet.

shaan1337 avatar shaan1337 commented on May 29, 2024

Managed to get a minimal repro of the issue: https://github.com/shaan1337/async-duplex-streaming-call-hang
Opened an issue on gRPC repo: grpc/grpc#25488

from eventstore-client-dotnet.

tambeau avatar tambeau commented on May 29, 2024

PR: #93 is closed

from eventstore-client-dotnet.

timothycoleman avatar timothycoleman commented on May 29, 2024

In the end dealt with in #172 by dropping the (short lived) support for net48

from eventstore-client-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.