• Vincent Pelletier's avatar
    ERP5Type.patches.CookieCrumbler: Fix balancer cookie logic. · 0732d589
    Vincent Pelletier authored
    Ever since the introduction of X-Balancer-Current-Server in SlapOS
    haproxy configuration in:
      commit c7f104fbf1f5948928f5545286afbb94fc39102b
      Author: Cédric Le Ninivin <cedric.leninivin@tiolive.com>
      Date:   Tue May 26 13:27:33 2015 +0200
    
          erp5_cluster: leave ERP5 set the haproxy cookie
    
    the balancer will overwrite this cookie's value, so do not compare it
    to our name: balancer may be calling us a name completely unrelated to
    the value getCurrentNode returns.
    So simplify this function's logic to only do what the docstring says:
    decide when to set and when to unset the balancer cookie, and let the
    balancer decide the value.
    This resolves cases where Zope would set the cookie over and over on
    every request when getCurrentNode and balancer disagree on its value.
    0732d589