Giter Club home page Giter Club logo

writehang's Introduction

About

This project reproduces a go networking issue. There is some combination of accumulated buffered data that leads to a hung Write() call.

To reproduce:

  1. go install .
  2. Open up two terminals, one for the server, the other for the client
  3. On the server terminal, run writehang server
  4. On the client terminal, run writehang client
  5. Wait for a few minutes

The repro seen should look like this on the server terminal:

...
sent 78282
sent 78283
received: processed 19657
sent 78284
sent 78285
sent 78286
sent 78287
received: processed 19658
sent 78288
received: processed 19659
received: processed 19660
received: processed 19661
received: processed 19662
received: processed 19663
received: processed 19664
...

The sent lines should continue endlessly, but they stop at some point. (Guess: socket buffers full?) At this point the code is stuck in waitWrite() in the go runtime.

Remove this line from sender.go and the wedge will happen almost immediately.

time.Sleep(time.Millisecond) // slow things for easier observation

This program was extracted from production software that is encountering occassional lockups. It's not clear if TLS is required for the repo and it probably isn't.

There is some test code included also for digging into the implementation.

writehang's People

Watchers

 avatar

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.