1. 30 Mar, 2018 2 commits
    • Stan Hu's avatar
      Merge branch 'load-balancer-connection-bug' into 'master' · 075aa9bc
      Stan Hu authored
      Catch errors in LoadBalancing::Host#online?
      
      See merge request gitlab-org/gitlab-ee!5177
      075aa9bc
    • Yorick Peterse's avatar
      Catch errors in LoadBalancing::Host#online? · 2648d6de
      Yorick Peterse authored
      Prior to this commit it was possible for Host#online? to raise a
      connection error when checking an already offline host. This could
      happen because certain methods used for checking if a host is available
      call the "connection" method, without catching any errors. As a result,
      if this method raises then #online? would also raise. All of this could
      lead to GitLab becoming unavailable depending on how many times it would
      try to use this offline host.
      
      To work around this we catch the errors that might be raised in
      Host#online?. Unlike the code in LoadBalancing::LoadBalancer we don't
      need to catch individual PG errors as we don't have to worry about
      application errors. This means we only have to catch up to three errors:
      
      1. ActionView::Template::Error (used inside views).
      
      2. ActiveRecord::StatementInvalid (used basically everywhere outside of
         views).
      
      3. PG::Error: used in some rare cases where Rails (for reasons unknown)
         doesn't wrap the original error.
      2648d6de
  2. 29 Mar, 2018 30 commits
  3. 28 Mar, 2018 8 commits