Forum Discussion

boneyard's avatar
Jan 02, 2015

iRule LB_FAILED event when not doing any load balancing

i have the following iRule on a standard virtual server without a default pool, no local traffic policies and no other iRules:

when HTTP_REQUEST {
  log local0. "HTTP_REQUEST"
  TCP::close
  return
}

when LB_FAILED {
  log local0. "LB_FAILED"
}

when i perform a single HTTP request is it logical that the LB_FAILED event is triggered? i mean nowhere any selection is made and the client side TCP session is closed. so why the LB_FAILED?

4 Replies

  • You're not going to get to LB_FAILED as no LB action was taken when you closed the connection with TCP::close, then exit with return. There's no server side connection needed, so no load balancing decision needs to be made.

     

  • giltjr's avatar
    giltjr
    Icon for Nimbostratus rankNimbostratus

    Sorry for the stupid question, but what are you trying to do? What do you expect to happen? If you are not doing load balancing, then why are you even checking for LB_FAILED?

     

  • giltjr's avatar
    giltjr
    Icon for Nimbostratus rankNimbostratus

    Well at a very high level, the only time LB_FAILED should be triggered is when LTM is fails to choose a pool or can't connect to a pool member.

     

    Since you have no pool associated with this VS, I would assume that LTM is triggering LB_FAILED, because there is no pool to choose.

     

    Ref:

     

    https://devcentral.f5.com/wiki/iRules.lb_failed.ashx

     

  • shaggy's avatar
    shaggy
    Icon for Nimbostratus rankNimbostratus

    not sure if the behavior is logical or not, but you may be able to avoid it by using the event command:

    when HTTP_REQUEST {
      log local0. "HTTP_REQUEST"
      TCP::close
      event LB_FAILED disable
      return
    }
    
    when LB_FAILED {
      log local0. "LB_FAILED"
    }