Giter Site home page Giter Site logo

ReadFrom() deadlock about sftp HOT 6 CLOSED

pkg avatar pkg commented on May 13, 2024
ReadFrom() deadlock

from sftp.

Comments (6)

eikenb avatar eikenb commented on May 13, 2024

I read through this and get the basic problem but it would take a good bit of work for me to get up to speed on the client code enough to have an idea of how to address this. Given that currently my focus is almost entirely on the server side code, this may not happen. I would however have time to review a pull request. So if you have an idea of how to fix things perhaps you would consider submitting a pull request with the fix + test. I don't mean to be dismissive of your issue, rather just honest about my time and what your best chances are of getting this fixed.

Thanks.

from sftp.

eikenb avatar eikenb commented on May 13, 2024

This looks very much like the hang in WriteTo fixed in PR #152. I'm going to look to see if the same fix would work here.

from sftp.

nekrondev avatar nekrondev commented on May 13, 2024

Thanks for your support! I am currently buried into different projects so there is little time for me right now to write test cases to probe the deadlock bug. For the tool where I used to transfer data to unreliable mobile WLAN connections the deadlock did not reappear after I fixed the sftp package like mentioned earlier.

Cheers and keep on the good work!
Nek

from sftp.

eikenb avatar eikenb commented on May 13, 2024

I was reviewing the code and I think all that this would take to trigger would be 1 successfully received packet followed by 2 errors. After 1 packet inFlight would be 0 (one added, one removed) and desiredInFlight would be 2 (started at 1, incremented once). So then if it received 2 errors in a row, they would both hit the immediate channel write in dispatchRequest causing the 2nd to lock.

I'm trying to figure out a way to write a test for this right now. I have yet to find a good place to force it to start returning errors after N packets are sent. I'm thinking maybe I could change things so I could replace packet.sendPacket() with a version of it that fails after N.

from sftp.

eikenb avatar eikenb commented on May 13, 2024

I replicated it.

from sftp.

eikenb avatar eikenb commented on May 13, 2024

Note that this also effects client.Write() as well.

from sftp.

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.