This set up error occasionally happens especialy when the user is trying to reassign the context path of the app, and it results in a hard-to-diagnose error, so we actively check this.
The mechanism is simple. This class occasionally updates a known file inside the hudson home directory, and whenever it does so, it monitors the timestamp of the file to make sure no one else is updating this file. In this way, while we cannot detect the problem right away, within a reasonable time frame we can detect the collision.
More traditional way of doing this is to use a lock file with PID in it, but unfortunately in Java, there's no reliabe way to obtain PID. @author Kohsuke Kawaguchi @since 1.178
|
|
|
|