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.

39 lines
1.4 KiB

  1. From 6026323cd0c235d6ab7ec039e5d735e7ea2e28bf Mon Sep 17 00:00:00 2001
  2. From: Willy Tarreau <w@1wt.eu>
  3. Date: Mon, 31 Oct 2016 17:32:20 +0100
  4. Subject: [PATCH 25/26] BUG/MEDIUM: peers: on shutdown, wake up the appctx, not
  5. the stream
  6. This part was missed when peers were ported to the new applet
  7. infrastructure in 1.6, the main stream is woken up instead of the
  8. appctx. This creates a race condition by which it is possible to
  9. wake the stream at the wrong moment and miss an event. This bug
  10. might be at least partially responsible for some of the CLOSE_WAIT
  11. that were reported on peers session upon reload in version 1.6.
  12. This fix must be backported to 1.6.
  13. (cherry picked from commit 78c0c50705a5e9d48607b9377adf030bb9d97b34)
  14. ---
  15. src/peers.c | 4 +---
  16. 1 file changed, 1 insertion(+), 3 deletions(-)
  17. diff --git a/src/peers.c b/src/peers.c
  18. index 7e1523f..db1f608 100644
  19. --- a/src/peers.c
  20. +++ b/src/peers.c
  21. @@ -1637,11 +1637,9 @@ static void peer_session_forceshutdown(struct stream * stream)
  22. if (ps)
  23. ps->reconnect = tick_add(now_ms, MS_TO_TICKS(50 + random() % 2000));
  24. - /* call release to reinit resync states if needed */
  25. - peer_session_release(appctx);
  26. appctx->st0 = PEER_SESS_ST_END;
  27. appctx->ctx.peers.ptr = NULL;
  28. - task_wakeup(stream->task, TASK_WOKEN_MSG);
  29. + appctx_wakeup(appctx);
  30. }
  31. /* Pre-configures a peers frontend to accept incoming connections */
  32. --
  33. 2.7.3