Comments (4)
These might generate some ideas:
- http://unix.stackexchange.com/questions/27636/how-does-ssh-connection-survive-a-network-restart
- 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.
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.
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.
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)
- Send messages on \n and not \r\n HOT 6
- Add system bell support to all messages, not just /msg or /reply's HOT 3
- Unable to start using `--unsafe-passphrase` HOT 1
- fuzzer crash HOT 1
- /op USER remove only works until USER reconnects HOT 1
- server: Support multiple identity private keys
- /back: Needs confirmation message
- Whitelist not applying HOT 10
- "ssh.chat" refuse connection HOT 2
- Latest DoS HOT 7
- 8 Vulnerable Dependences per OWASP Dependency Check HOT 2
- Known bug: ssh rsa negotiation issue HOT 5
- COMMANDS ARE CASE SENSITIVE HOT 5
- bot: Skip motd on connect HOT 2
- bot: Don't include emoji prefixes in DMs
- Emojis still appear in TERM=bot mode private messages HOT 1
- Release v1.11 proper HOT 1
- Couldn't connect with allowlist or get admin HOT 2
- problem with using backspace for Chinese characters(one char of 2 bytes) HOT 9
- Very stupid question HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ssh-chat.