Possible DoubleLaunchChecker false positive

4 views
Skip to first unread message

Cline, WadeX

unread,
Mar 23, 2020, 4:58:30 PM3/23/20
to jenkins...@googlegroups.com
Hello,

A few days ago we ran into an issue where Jenkins reported that two instances were running with the same host directory:

--------
Error

Jenkins detected that you appear to be running more than one instance of Jenkins that share the same home directory '/var/lib/jenkins'. This greatly confuses Jenkins and you will likely experience strange behaviors, so please correct the situation.
This Jenkins:1541674003 contextPath="" at 29119@NPG-CID-Jenkins-OR Other Jenkins:1541674003 contextPath="" at 29119@NPG-CID-Jenkins-OR
--------

The two identifiers reported were exactly the same. Looking at the source, I found 'core/src/main/java/hudson/util/DoubleLaunchChecher.java', and, from there, found the following entry in the Jenkins log file:

--------
2020-03-17 01:14:10.096+0000 [id=66] SEVERE hudson.util.DoubleLaunchChecker#execute: Collision detected. timestamp=1584403930000, expected=1584403930092
--------

Note that the time stamps are a mere 92 milliseconds apart and appear to be from the same instance. At first I expected that this might be a filesystem timestamp resolution issue, but running 'ls -a --full-time' showed that the filesystem did indeed support high-resolution timestamps (output snipped):

--------
-rw-r--r-- 1 jenkins jenkins 53 2020-03-20 11:50:10.193592799 -0700 .owner
--------

I also wrote a quick Java test program to see if the timestamping code worked as expected, and it did indeed:

--------
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.io.IOException;

public class Test {
public static void main(String args[]) {
File timestampFile = new File(".owner");
long t = timestampFile.lastModified();
try {
FileUtils.writeStringToFile(timestampFile, "Oh God how did this get here I am not good with computer");
} catch (IOException e) {
System.out.println("It broke");
}
long t2 = timestampFile.lastModified();
System.out.println("Old Timestamp: " + t);
System.out.println("New Timestamp: " + t2);
}
}
--------
root@NPG-CID-Jenkins-OR:~# java -cp "/root/jenkins/WEB-INF/lib/" ./Test.java
Note: ./Test.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Old Timestamp: 1584733878748
New Timestamp: 1584734059361
root@NPG-CID-Jenkins-OR:~# java -cp "/root/jenkins/WEB-INF/lib/" ./Test.java
Note: ./Test.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Old Timestamp: 1584734059361
New Timestamp: 1584734060529
root@NPG-CID-Jenkins-OR:~# java -cp "/root/jenkins/WEB-INF/lib/" ./Test.java
Note: ./Test.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Old Timestamp: 1584734060529
New Timestamp: 1584734062861
--------

So now I suspect that perhaps the DoubleLaunchChecker is erroneously being run twice on startup, but am not sure how I would test that hypothesis.

Has anyone seen this issue before, or have any ideas how to debug it?

Since the issue appears to be a false positive we've gone ahead and told Jenkins to ignore the issue for now.

Thanks,
Wade
Reply all
Reply to author
Forward
0 new messages