Comment 2 for bug 1268619

Revision history for this message
Bill Erickson (berick) wrote :

Another TODO:

Since we're using Apache, we can prevent new WS connections on a given server the same as we do with gateway/translator connections, via ldirector (etc.) ping files. However, we also need a way to prevent existing clients from sending new requests when an apache server wants to disconnect.

Related, we also need to add support for a timeout-based disconnects. Forcing clients to disconnect after a period of inactivity ensures Apache processes are given a chance to clear the Apache memory pool for the request and, more importantly, will allow the Apache process count to settle down after periods of high activity. In other words, if your browser is sitting idle for an hour, there is no reason it should hog an Apache process.

The client code is already capable to detecting a broken socket and reconnecting. Whats' more, the reconnect process is roughly equivalent to a single XMLHttpRequest, so it's not something the user should generally notice. So, we only need to the server pieces to set a timeout (via apache config) and send a disconnect to the client when the timeout is reached. With this, we can also support graceful shutdown by setting the timeout temporarily very low (say, via signal), which will cause a disconnect of all clients while they are idle, forcing them to reconnect to another server.