[lxc-devel] [lxc/lxc] f893d8: commands: fix race when open()/close() cmd socket

GitHub noreply at github.com
Thu Dec 14 21:56:25 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: f893d898079004d198064337a4879bce5b28c9d8
      https://github.com/lxc/lxc/commit/f893d898079004d198064337a4879bce5b28c9d8
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-12-14 (Thu, 14 Dec 2017)

  Changed paths:
    M src/lxc/start.c

  Log Message:
  -----------
  commands: fix race when open()/close() cmd socket

When we report STOPPED to a caller and then close the command socket it is
technically possible - and I've seen this happen on the test builders - that a
container start() right after a wait() will receive ECONNREFUSED because it
called open() before we close(). So for all new state clients simply close the
command socket. This will inform all state clients that the container is
STOPPED and also prevents a race between a open()/close() on the command socket
causing a new process to get ECONNREFUSED because we haven't yet closed the
command socket.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: 389c46753ba4a8bf446575cc6e2ab508309bd9b2
      https://github.com/lxc/lxc/commit/389c46753ba4a8bf446575cc6e2ab508309bd9b2
  Author: Serge Hallyn <serge at hallyn.com>
  Date:   2017-12-14 (Thu, 14 Dec 2017)

  Changed paths:
    M src/lxc/start.c

  Log Message:
  -----------
  Merge pull request #2039 from brauner/2017-12-14/fix_command_socket_race

commands: fix race when open()/close() cmd socket


Compare: https://github.com/lxc/lxc/compare/ec09a5a2de76...389c46753ba4


More information about the lxc-devel mailing list