GithubHelp home page GithubHelp logo

Comments (5)

edsburke avatar edsburke commented on April 28, 2024

I happen to run EchoServer and EchoClient in the wangle examples. It confirms CLOSE_WAIT issue also exists. CLOSE_WAIT socks just accumulate and transition to dangling status forever, and are never released unless the process is killed.

Could anyone suggest what should be done to debug/fix this issue? Thanks.

netstat output of EchoClient

tcp        0      0 172.31.38.97:64115      54.118.66.170:8080       FIN_WAIT2
tcp        0      0 172.31.38.97:64117      54.118.66.170:8080       FIN_WAIT2

netstat output of EchoServer

tcp6       0      0 54.118.66.170:8080      172.31.38.97:64115     CLOSE_WAIT
tcp6       0      0 54.118.66.170:8080      172.31.38.97:64117     CLOSE_WAIT

lsof -p 2825 | grep TCPv6

EchoServe 2825 root   20u     sock                0,8      0t0 2044556 protocol: TCPv6
EchoServe 2825 root   23u     sock                0,8      0t0 2044795 protocol: TCPv6

from wangle.

edsburke avatar edsburke commented on April 28, 2024

Just verified the latest code v2020.04.06.00 has the same issue on Ubuntu 16.04.
Running multiple times ./EchoClient from one machine(i.e. 172.31.38.97), ./EchoServer is running from another machine (i.e. 172.26.1.197). When EchoClient is done, many CLOSE_WAIT server socks are lingering there.

Note that tcp_fin_timeout has been tuned on client machine to be long enough (120 seconds) so that EchoServer has the chance to send LAST_ACK.

TCP: About FIN_WAIT_2, TIME_WAIT and CLOSE_WAIT

netstat -anp | grep EchoServer

tcp6       0      0 :::8080                 :::*                    LISTEN      26314/EchoServer
tcp6       0      0 172.26.1.197:8080       172.31.38.97:48758     CLOSE_WAIT  26314/EchoServer
tcp6       0      0 172.26.1.197:8080       172.31.38.97:48756     CLOSE_WAIT  26314/EchoServer
tcp6       0      0 172.26.1.197:8080       172.31.38.97:48762     CLOSE_WAIT  26314/EchoServer
tcp6       0      0 172.26.1.197:8080       172.31.38.97:48754     CLOSE_WAIT  26314/EchoServer
tcp6       0      0 172.26.1.197:8080       172.31.38.97:48770     CLOSE_WAIT  26314/EchoServer
tcp6       0      0 172.26.1.197:8080       172.31.38.97:48764     CLOSE_WAIT  26314/EchoServer
tcp6       0      0 172.26.1.197:8080       172.31.38.97:48760     CLOSE_WAIT  26314/EchoServer
tcp6       0      0 172.26.1.197:8080       172.31.38.97:48766     CLOSE_WAIT  26314/EchoServer
tcp6       0      0 172.26.1.197:8080       172.31.38.97:48768     CLOSE_WAIT  26314/EchoServer

from wangle.

edsburke avatar edsburke commented on April 28, 2024

Try to bump this thread. Hey Wangle team, could you please suggest how should it be debugged or fixed? Thanks a lot.

from wangle.

edsburke avatar edsburke commented on April 28, 2024

Does Wangle team notice this big issue from user community? Please kindly advice how to fix it or work it around? Appreciated!

from wangle.

wallel avatar wallel commented on April 28, 2024

You should close the socket after client leaved,use EchoServer as a example

class EchoHandler :public wangle::HandlerAdapter<std::string> {
public:
    void read(Context* ctx, std::string msg)override {
        std::cout << "handling " << msg << std::endl;
        write(ctx, msg + "\r\n");
    }
   // close the socket
    void readEOF(Context* ctx) {
        ctx->fireClose();
    }
};

from wangle.

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.