<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div>Hi,<br><br></div>I have come across a few bug reports [1][2] (and a feature request from the Swarm team) recently that are essentially caused by an application being accessed before it is fully deployed. Basically even though we have service dependencies that make sure individual components dependencies are up, once a request has been accepted it can potentially programmatically access other parts of the deployment that are not up yet (basically the same problem we have with graceful shutdown, but in reverse).<br><br></div>I propose we solve this using a &#39;graceful startup&#39; mechanism, that holds or rejects new requests until a server or deployment is fully started. The specifics of how this would work are:<br><br></div>- If the server is booting all external requests will be held or rejected until the the boot process is complete<br></div>- When deploying a new deployment all requests for that deployment will be held or rejected until MSC has attained stability<br><br></div>This would be implemented for the following endpoints/subsystems:<br><br></div>- Undertow will hold requests until the deployment is done (so if you try and load a page while deployment is happening it could be a bit of a wait)<br></div>- Remote EJB will hold requests until deployment is done<br></div>- mod_cluster will not send availability messages until deployment is done<br></div>- JMS will delay message delivery until deployment is done<br></div>- EJB persistent timers will not fire until deployment is done<br></div>- Possibly some other cases I can&#39;t think of right now<br><br></div>One thing I am not really sure about is if we need a configuration switch for hold/reject behavior. e.g. for Undertow the request holding behavior is very developer friendly, as it means they can just hit refresh in their browser and as soon as the redeployment is done the page will display, however I am worried that it might not be ideal for load balancers that may prefer a quick error response that could then be attempted on another node (although if mod_cluster is not sending out availability till the deployment is 100% complete this may not be a big deal).<br><br></div><div>If you want to see this in action I have a very simple PR at [3] that enables this for Undertow at server boot. <br></div><div><br></div>Thoughts?<br><br></div>Stuart<br><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><br>[1] <a href="https://issues.jboss.org/browse/WFLY-6402">https://issues.jboss.org/browse/WFLY-6402</a><br>[2] <a href="https://issues.jboss.org/browse/JBEAP-867">https://issues.jboss.org/browse/JBEAP-867</a><br>[3] <a href="https://github.com/wildfly/wildfly/pull/8858">https://github.com/wildfly/wildfly/pull/8858</a><br><br><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>