1

we are getting this exception:

TimeoutException: JBAS010213: Cannot acquire lock default-host/...

We are using this PhaseListener in our web application to capture session timeout on ajax requests and redirect to index (we are suspecting this could be related, but we dont know):

public class SessionExpirationPhaseListener implements PhaseListener {

@Override
public PhaseId getPhaseId() {

    return PhaseId.RESTORE_VIEW;

}

@Override
public void beforePhase(PhaseEvent event) {
}

@Override
public void afterPhase(PhaseEvent event) {
    FacesContext context = FacesContext.getCurrentInstance();
    HttpServletRequest httpRequest = (HttpServletRequest) context.getExternalContext().getRequest();
    if (httpRequest.getRequestedSessionId() != null && !httpRequest.isRequestedSessionIdValid()) {
        String facesRequestHeader = httpRequest.getHeader("Faces-Request");
        boolean isAjaxRequest = facesRequestHeader != null && facesRequestHeader.equals("partial/ajax");
        // navigate to home page only for ajax requests
        if (isAjaxRequest) {
            ConfigurableNavigationHandler handler = (ConfigurableNavigationHandler) context.getApplication().getNavigationHandler();
            handler.performNavigation("home");
        }
    }
}

}

We are running over a JBoss cluster with 2 nodes (mod_cluster + apache) and have SSO enabled. Do you guys know what could be wrong? Or at least point us to the right direction?

Thanks, Regards.

Mateo
  • 75
  • 1
  • 12

1 Answers1

1

I believe the problem here are to two nodes trying to get access to the same session, where one node is handling an incoming request, and the second node is performing a session expiration.

Check cookies are being sent in your ajax call, a possible problem is the execution of phase listener in the node that not be owner of session.

EDIT:

Exist this bug maybe associated to this problem: https://bugzilla.redhat.com/show_bug.cgi?id=993041

Federico Sierra
  • 5,118
  • 2
  • 23
  • 36
  • We removed the SessionExpirationPhaseListener, and still happening. – Mateo Nov 04 '14 at 13:05
  • 1
    @Mateo please take a look in links that I have added to answer. – Federico Sierra Nov 04 '14 at 13:22
  • The first link appears to be really similar to our scenario, but i dont understand the second one. – Mateo Nov 04 '14 at 14:40
  • Thanks @Federico, Reading this https://developer.jboss.org/thread/162109?start=0&tstart=0 , i realized that setting stickySessionsRemove to true in JBoss could be a possible solution. We are testing that on production right now. – Mateo Nov 05 '14 at 12:58
  • Ok, the scenario we are dealing with is the next: The first login of the day gets like 5 minutes to complete, the rest of the day all ok. No logs, any idea? – Mateo Nov 07 '14 at 11:22
  • We have an apache2 in front of the cluster, i checked the logs and at that time on error.log(apache): [Thu Nov 06 08:34:29 2014] [error] (70007)The timeout specified has expired: ajp_ilink_receive() can't receive header [Thu Nov 06 08:34:29 2014] [error] ajp_read_header: ajp_ilink_receive failed [Thu Nov 06 08:34:29 2014] [error] (70007)The timeout specified has expired: proxy: dialog to MY_IP:MY_PORT (MY_DOMAIN) failed [Thu Nov 06 08:34:30 2014] [error] proxy: ajp: disabled connection for (MY_DOMAIN) [Thu Nov 06 08:34:35 2014] [error] proxy: ajp: disabled connection for (MY_DOMAIN) – Mateo Nov 07 '14 at 17:46
  • And on other_vhosts_access.log: DISABLE-APP / HTTP/1.1" 200 205 "-" "ClusterListener/1.0 – Mateo Nov 07 '14 at 17:46
  • 1
    take a look in this issue https://issues.jboss.org/browse/MODCLUSTER-425, maybe playing with max-connections on JBoss side helps – Federico Sierra Nov 07 '14 at 17:51
  • I think upgrading to EAP 6.4 would help you. – Federico Sierra Nov 07 '14 at 17:58