[Nbd] Restart without killing clients
- To: nbd-general@lists.sourceforge.net
- Subject: [Nbd] Restart without killing clients
- From: Wouter Verhelst <w@...112...>
- Date: Thu, 6 Oct 2016 14:43:35 +0200
- Message-id: <20161006124335.fovtedvlv6fzom7v@...3...>
Hi folks,
One major limitation which nbd-server currently has is that you can't
restart it without killing all existing connections. This isn't ideal.
The reason I wrote it that way is that when you shut down the server,
it should really stop all processes.
However, recently I've become more and more convinced that in the case
of nbd, this doesn't really make much sense. Sure, when a webserver
restarts, it doesn't hurt to restart the forked off processes of that
webserver, since they're all serving short-lived TCP connections anyway.
However, the same is simply not true for nbd; we serve long-lived TCP
connections, and killing the child processes of the master nbd-server
impacts clients.
I think it's time I thought about a way to restart the server without
impacting existing clients. Since nbd uses a fork-per-client method,
this shouldn't be too hard (just stop proxying signals from the master
process to its child processes, instead just shutdown the master process
and be done with it). However, it might be interesting to allow clients
to remain running when restarting the server, but not when shutting it
down, even if the server had been restarted at some prior point. I guess
this should be possible using some IPC method, but I'm not sure whether
the extra complexity required for that is worth it.
Thoughts?
--
< ron> I mean, the main *practical* problem with C++, is there's like a dozen
people in the world who think they really understand all of its rules,
and pretty much all of them are just lying to themselves too.
-- #debian-devel, OFTC, 2016-02-12
Reply to: