Giter Site home page Giter Site logo

Comments (5)

mgravell avatar mgravell commented on September 21, 2024 3

Awesome, great to hear - and great to fix this bug; I hadn't seen it, but: quite likely it was causing some connection failures that I wasn't attributing to this, especially under load

from pipelines.sockets.unofficial.

patricksuo avatar patricksuo commented on September 21, 2024 2

I see the same error in v2.0.7.
EDIT:
I think I forget to cleanup and rebuild everything.

Looks good after a few round tests. Confirmed the fix.
Thanks!

from pipelines.sockets.unofficial.

mgravell avatar mgravell commented on September 21, 2024 1

v2.0.7 uploaded to nuget - please let me know how you get on, and thanks for a great error report

from pipelines.sockets.unofficial.

mgravell avatar mgravell commented on September 21, 2024

I am very intrigued! Below is mostly my thought process while reading it. Sorry if it is disjointed - that's just how I think.

It looks like the problem here is with the actual list - I can't see any other way for System.Collections.Generic.List1.get_Item(Int32 index)` to throw, when it is accessed via:

 int bufferCount = value.Count;
...
for (int i = 0; i < bufferCount; i++)
{
    ArraySegment<byte> buffer = value[i];
    RangeValidationHelpers.ValidateSegment(buffer);
    _bufferListInternal.Add(buffer);
}

so yes, I agree that the most likely problem here is somehow two threads squabbling over the same list. I'd also be happy to conclude that buffer coming out incomplete (a torn value) would be a possible cause of the second stack-trace, if we accept that the first stack-trace is caused by two threads fighting over the list.

So... how could such a thing have happened? (scratches beard)

I suspect that the problem is: in the "socket work completed synchronously case" we're recycling the buffer, but not clearing the buffer-list on the socket-args - that list is then up for grabs, and if the next IO work is also multi-buffer, we'll get into problems. Yeah, I'm pretty confident that's what has happened... fixing.

(minor edits to clarify wording - see history)

from pipelines.sockets.unofficial.

patricksuo avatar patricksuo commented on September 21, 2024

I will test it tomorrow. thank you!

from pipelines.sockets.unofficial.

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.