Skip to content

RFC multipath-tools: Fix remaining shutdown delay issues

Martin Wilck dm-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6multipathd: fix daemon not really shutdownmultipathd/main.c+1 -11 reply
2/6multipathd: protect all access to running_statemultipathd/main.c+48 -311 reply
3/6multipathd: allow shutdown during configure()libmultipath/configure.c libmultipath/discovery.c libmultipath/exit.h +3 more+43 -01 reply
4/6multipathd: cancel threads early during shutdownmultipathd/main.c+9 -85 replies
5/6multipathd: add code to handle blocked signalsmultipathd/main.c multipathd/main.h+26 -02 replies
6/6multipathd: uxlsnr: handle signals while busymultipathd/cli.c multipathd/cli.h multipathd/main.c+40 -162 replies

Reviews trailers per patch

2 of 6 patches have a Reviewed-by or Acked-by.

PatchBenjamin MarzinskiChongyun Wu
SeriesT-b
1/6R-b
2/6R-b
3/6
4/6
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 0/6] multipath-tools: Fix remaining shutdown delay issues

Hi Chongyun, Ben, all,

this patch set addresses the points where I can see that handling of shutdown signals may be delayed, as discussed previously. Quoting my previous post:

Let's summarize how multipathd exit works today:

1. signal arrives
(signal may be blocked while uxlsnr is busy, see above)
2. signal is unblocked in uxlsnr thread (in ppoll())
3. signal handler sets exit_sig()
4. uxlsnr calls handle_signals()
5. handle_signals()->exit_daemon() sets DAEMON_SHUTDOWN() and posts
config_cond (child may busy in reconfigure())
6. child detects DAEMON_SHUTDOWN and quits main loop
7. child locks vecs->lock (may cause wait)
8. sets dm_queue_if_no_path, cancels threads, and exits.

I can imagine delays in step 1, 5, and 7, but not in ppoll().

This series addresses 1) in patch 5 and 6, 5) in patch 3, and 7) in patch 4. The series also contains the part of Chongyun's previously posted patch which I agree with.

The set is compile tested, but no more so far. Chongyun, I'd be grateful if you could review it, and give it a try in your test setup.

Chongyun Wu (1):
multipathd: fix daemon not really shutdown

Martin Wilck (5):
multipathd: protect all access to running_state
multipathd: allow shutdown during configure()
multipathd: cancel threads early during shutdown
multipathd: add code to handle blocked signals
multipathd: uxlsnr: handle signals while busy

 libmultipath/configure.c |   5 ++
 libmultipath/discovery.c |   4 ++
 libmultipath/exit.h      |   5 ++
 mpathpersist/main.c      |   5 ++
 multipath/main.c         |   6 ++
 multipathd/cli.c         |  50 ++++++++++----
 multipathd/cli.h         |   2 +-
 multipathd/main.c        | 143 ++++++++++++++++++++++++++++-----------
 multipathd/main.h        |   1 +
 9 files changed, 166 insertions(+), 55 deletions(-)
 create mode 100644 libmultipath/exit.h
Signature · 1 line
2.19.2