Tomcat has a feature to deploy a new version with no downtime and gracefully undeploy an old version (when no sessions are left from an old client).
All you need to start using this feature is setting undeployOldVersions to true and have a .war file with a name of special format.
My experiments have shown that it waits at least 10 minutes (in the absence of traffic) to undeploy an old version. Is this timeout configurable in Tomcat settings?