The application contexts are enabled to mod_cluster for servers that are started in suspended mode in JBoss EAP 7.2

Solution Verified - Updated

Environment

Red Hat JBoss Enterprise Application Platform (EAP) 7.2.x

Issue

  • Undertow is running as a load-balancer. Suspended servers are still registering their node/contexts to mod_cluster on the start up. It is resulting in 503 code.
$ sh standalone.sh -c standalone-ha.xml  --start-mode=suspend

Resolution

For the application contexts to do not serve new requests after start up, it is possible to configure in the mod_cluster subsystem auto-enable-contexts set to false:

<subsystem xmlns="urn:jboss:domain:modcluster:4.0">
    <proxy name="default" advertise-socket="modcluster" listener="ajp" auto-enable-contexts="false">

To enable the contexts, change auto-enable-contexts to true and reload.

Root Cause

After Jira This content is not included.JBEAP-18610 the application contexts are not enabled in mod_cluster in JBoss EAP 7.2 CP08. Application contexts are still registered to mod_cluster and it can serve new requests returning 503.

Diagnostic Steps

When the server is suspended, mod_cluster sends to proxy to stop the context.

DEBUG [org.jboss.modcluster] (ServerService Thread Pool -- 6) MODCLUSTER000008: Received stop context event for default-host:/appname
DEBUG [org.jboss.modcluster] (ServerService Thread Pool -- 6) MODCLUSTER000010: Sending DISABLE-APP for default-host:/appname
INFO  [org.jboss.modcluster] (ServerService Thread Pool -- 6) MODCLUSTER000021: All pending requests drained from default-host:/appname in 0.0 seconds

From undertow:

DEBUG [io.undertow] (default task-1) UT005057: Sending MCMP response to destination: /127.0.0.1:44386, HTTP status: 200, Headers: {Content-Type=[text/plain; charset=ISO-8859-1]}, response: Type=STOP-APP-RSP,JvmRoute=slave:server1Alias=default-host,localhostContext=/appnameRequests=0

But when starting the server in suspended mode, the contexts are enabled:

DEBUG [org.jboss.modcluster] (ServerService Thread Pool -- 81) MODCLUSTER000005: Received add context event for default-host:/appname
DEBUG [org.jboss.modcluster] (ServerService Thread Pool -- 81) MODCLUSTER000007: Received start context event for default-host:/appname
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.