Code Monkey home page Code Monkey logo

Comments (4)

film42 avatar film42 commented on May 2, 2024

These might generate some ideas:

  1. http://unix.stackexchange.com/questions/27636/how-does-ssh-connection-survive-a-network-restart
  2. http://www.cyberciti.biz/faq/if-sshd-is-restart-will-any-connections-be-disconnected/

Edit: They're just TCP sockets at the end of the day, so handling them like an HTTP server with sockets should be the same, right?

from ssh-chat.

mrfabbri avatar mrfabbri commented on May 2, 2024

DISCLAIMER: very very beginner Go level here, so I may have totally misinterpreted/mystified things, still the project is neat and the problem (graceful restart with persistent connections) is interesting.

Basically, both rcrwoley/goagain and facebookgo/grace provide same way to recover Listener connections from the restarted process (via a clever use of environment variables for passing the number/file descriptors of active listener connections, and then getting back the net connection from the file descriptor).

I guess a similar approach can be replicated on the file descriptors of the active connections but will prove slightly more complicated than with just Listener connection(s) (Accept() makes a very natural point where to break/restart the service and almost no state is carried across restart):

  • some state to rebuild clients (from connection file descriptors) should be saved/serialised somewhere;
  • client.handleChannels() should be "restart-wise" and handle the restart gracefully (stopping at the "right" point / saving info for restart).

Well, maybe this would just turn out an "ad-hoc, informally specified, implementation of half of a failover proxy frontend".

from ssh-chat.

persontwo avatar persontwo commented on May 2, 2024

Maybe a small proxy could be written in Erlang? I dunno, I've just heard people talk about hot code reloading in Erlang.

from ssh-chat.

persontwo avatar persontwo commented on May 2, 2024

There's a thread on HN today about graceful server restart with Go: https://news.ycombinator.com/item?id=8772636. Might be of interest to you.

from ssh-chat.

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.