You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.8 KiB

  1. From 8253b517585a664be53718f1522e24291f553d95 Mon Sep 17 00:00:00 2001
  2. From: Christopher Faulet <cfaulet@haproxy.com>
  3. Date: Thu, 23 Feb 2017 10:17:15 +0100
  4. Subject: [PATCH 2/7] BUG/MINOR: spoe: Fix soft stop handler using a specific
  5. id for spoe filters
  6. During a soft stop, we need to wakeup all SPOE applets to stop them. So we loop
  7. on all proxies, and for each proxy, on all filters. But we must be sure to only
  8. handle SPOE filters here. To do so, we use a specific id.
  9. (cherry picked from commit 3b386a318f699def6f37b4d3199cd1d72c481a0f)
  10. ---
  11. src/flt_spoe.c | 14 ++++++++++++--
  12. 1 file changed, 12 insertions(+), 2 deletions(-)
  13. diff --git a/src/flt_spoe.c b/src/flt_spoe.c
  14. index aa6414a..2a96c65 100644
  15. --- a/src/flt_spoe.c
  16. +++ b/src/flt_spoe.c
  17. @@ -235,6 +235,9 @@ struct spoe_context {
  18. unsigned int process_exp; /* expiration date to process an event */
  19. };
  20. +/* SPOE filter id. Used to identify SPOE filters */
  21. +const char *spoe_filter_id = "SPOE filter";
  22. +
  23. /* Set if the handle on SIGUSR1 is registered */
  24. static int sighandler_registered = 0;
  25. @@ -2286,10 +2289,16 @@ sig_stop_spoe(struct sig_handler *sh)
  26. struct flt_conf *fconf;
  27. list_for_each_entry(fconf, &p->filter_configs, list) {
  28. - struct spoe_config *conf = fconf->conf;
  29. - struct spoe_agent *agent = conf->agent;
  30. + struct spoe_config *conf;
  31. + struct spoe_agent *agent;
  32. struct appctx *appctx;
  33. + if (fconf->id != spoe_filter_id)
  34. + continue;
  35. +
  36. + conf = fconf->conf;
  37. + agent = conf->agent;
  38. +
  39. list_for_each_entry(appctx, &agent->cache, ctx.spoe.list) {
  40. si_applet_want_get(appctx->owner);
  41. si_applet_want_put(appctx->owner);
  42. @@ -3178,6 +3187,7 @@ parse_spoe_flt(char **args, int *cur_arg, struct proxy *px,
  43. }
  44. *cur_arg = pos;
  45. + fconf->id = spoe_filter_id;
  46. fconf->ops = &spoe_ops;
  47. fconf->conf = conf;
  48. return 0;
  49. --
  50. 2.10.2