[CRIU] restore of deleted standalone unix sockets
Tycho Andersen
tycho.andersen at canonical.com
Tue Jun 28 07:49:54 PDT 2016
On Tue, Jun 28, 2016 at 03:37:24PM +0300, Pavel Emelyanov wrote:
> On 06/22/2016 08:35 PM, Tycho Andersen wrote:
> > Hi guys,
> >
> > I noticed that restoring of standalone unix sockets in the LISTEN state fails,
> > because we don't keep the address during the dump phase, and the kernel expects
> > us to bind() to an address before we can listen() on these sockets (see test
> > for an example).
> >
> > One problem with this patch is that if there are two sockets bound to the same
> > path, but one was deleted, we could fail if we restore the non-deleted one
> > first. I think there are a few options for this:
> >
> > 1. Try to order the sockets so they're always restored in the right order
> > (similar to how the process did it the first time). I'm not aware of any
> > ordering hooks we have in the code to do this.
> > 2. Try to bind the socket to some other path; since it is deleted, nobody can
> > connect to it anyway, so it doesn't matter where it's bound.
> > 3. Don't care about this case ;)
>
> 4. Move the offending path, bind the socket, move the original path back %)
>
> > Anyway, here's a first draft of a set, let me know what you think.
>
> I'd appreciate either of 1, 2 or 4 to get fixed, since AFAIK unlinking of
> a socket and binding another one under the same name is standard practice
> when restarting daemons, so we will definitely step into this soon. Now
> we don't as we just forget the name for unlinked sockets.
Yes, I'll do 4 I hadn't thought of that :)
Tycho
> -- Pavel
>
More information about the CRIU
mailing list