Community
Participate
Working Groups
Build Identifier: 7.5.4.v20111024 on linux I have a context serving /static from /opt/foo/current. /opt/foo/current is a symlink to /opt/foo/2011010101 When a file from /static is requested it is cached in the server. Now if I switch the /opt/foo/current link to point to /opt/foo/2011020202. Where the contents of the files are different from what was in /opt/foo/2011010101 Jetty continues to serve the old content until the server is restarted. This method of linking statics is a good way to get atomic deploys of statics. Reproducible: Always Steps to Reproduce: 1. Create symlink /opt/foo/current pointing to a directory /opt/foo/bar 2. Create a Context serving /static from /opt/foo/current 3. Get a file from /static 4. Move the symlink /opt/fooo/current to /opt/foo/baz 5. Get the same file as in step 3. Notice it is the old file.
Context: https://gist.github.com/1384384 repo: https://gist.github.com/1384391
The issue is that on unix, links are resolved when a File Descriptor is obtained, thus changing a symlink to a directory does not make any change at all to the File Descriptor held by the jetty file cache, thus no change is noticed. It might be possible to add a watch file to the cache, that could be set to be the symlink itself. If the watch file changes, the entire resource cache can be flushed. Alternately, a cache flush could be scheduled every few seconds, which would not have a huge impact on scalability, but would help development mode.
bumping this up to jetty9 to be fixed, since java 7 is in play which has support for symbolic links we should be able to resolve this reasonable
reasonably sure this was resolved ages ago