The only instance that the tempDir cant be reused is when it is not deleted when the webapp stops.
On WebAppContext.doStop, the snippet:
if (_tmpDir!=null && Unable to render embedded object: File (_isExistingTmpDir && !isTempWorkDirectory()) //_tmpDir) not found.=null && !"work".equals(_tmpDir.getName()))
I did some digging and found out that the Windows FileMappedBuffer "files-locked" issue is causing the problem.
When the static files are accessed from the browser, those files cannot be edited nor deleted.
So when the webapp restarts, it cannot delete the webapp unless the DefaultServlet frees up the resources... which
would eventually need a server restart.(unless there is a way to redeploy just the DefaultServlet?)
To reproduce, you'd have to deploy, acces the app(static files), then undeploy.
Wasnt able to reproduce earlier because I did deploy and undeploy only without accessing.