JDK-4673298 : (prefs) Locking in Preferences sometimes fails on NFS mounted drives (Linux)
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 1.4.0,1.4.1,1.4.2,5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux,solaris_8
  • CPU: x86,sparc
  • Submitted: 2002-04-23
  • Updated: 2007-11-13
  • Resolved: 2007-11-13
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Description
Sometimes locking fails on NFS mounted drives on Linux. We need to investigate this in detail.

###@###.### 2002-05-28

Name: as83306			Date: 12/12/2001

Regression test java/util/prefs/ExportNode.java fails with Merlin build 89 on Sol2.8-64, host grus. This test previously failed in bug 4446765, but this is a different failure.
 
 For test hardware config's, see http://sqesvr.eng/st3/jdk1.4/docs/Merlin-hw.html
#Test Results (version 2)
#Mon Dec 10 17:05:01 PST 2001
#checksum:23f617bf8680e63a
#-----testdescription-----
$file=/net/sqesvr/export/st1/regression/merlin/jdk1.4Tests/tests/b89/java/util/prefs/ExportNode.java
$root=/net/sqesvr/export/st1/regression/merlin/jdk1.4Tests/tests/b89
author=Konstantin Kladko
keywords=bug4387136
run=ASSUMED_ACTION main ExportNode\n
source=ExportNode.java
title=Due to a bug in XMLSupport.putPreferencesInXml(...),  node's keys would not get exported.

#-----environment-----

#-----testresult-----
description=file:///net/sqesvr/export/st1/regression/merlin/jdk1.4Tests/tests/b89/java/util/prefs/ExportNode.java
end=Mon Dec 10 17:05:01 PST 2001
environment=regtest
execStatus=Failed. Execution failed: `main' threw exception: java.util.prefs.BackingStoreException: Couldn't get file lock.
javatestOS=SunOS 5.8 (sparcv9)
javatestVersion=2.1.5
script=com.sun.javatest.regtest.RegressionScript 
sections=script_messages build compile main
start=Mon Dec 10 17:04:54 PST 2001
status=Failed. Execution failed: `main' threw exception: java.util.prefs.BackingStoreException: Couldn't get file lock.
test=java/util/prefs/ExportNode.java
work=/export0/results/regression/merlin/b89/grus5.8-jthb89-jdk14b89.12-10.13.44-ALL-64/java/util/prefs

#section:script_messages
----------messages:(4/195)----------
JDK under test: (/export0/java/jdk14b89)
java version "1.4.0-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-rc-b89)
Java HotSpot(TM) Client VM (build 1.4.0-rc-b89, mixed mode)

#section:build
----------messages:(3/96)----------
command: build ExportNode 
reason: Named class compiled on demand
elapsed time (seconds): 3.147
result: Passed. Compilation successful

#section:compile
----------messages:(3/193)----------
command: compile /net/sqesvr/export/st1/regression/merlin/jdk1.4Tests/tests/b89/java/util/prefs/ExportNode.java 
reason: .class file out of date or does not exist
elapsed time (seconds): 3.142
----------System.out:(0/0)----------
----------System.err:(0/0)----------
result: Passed. Compilation successful

#section:main
----------messages:(3/119)----------
command: main ExportNode
reason: Assumed action based on file name: run main ExportNode 
elapsed time (seconds): 4.034
----------System.out:(0/0)----------
----------System.err:(14/839)----------
java.util.prefs.BackingStoreException: Couldn't get file lock.
	at java.util.prefs.FileSystemPreferences.removeNode(FileSystemPreferences.java:619)
	at ExportNode.main(ExportNode.java:20)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:536)

JavaTest Message: Test threw exception: java.util.prefs.BackingStoreException: Couldn't get file lock.
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.util.prefs.BackingStoreException: Couldn't get file lock.
result: Failed. Execution failed: `main' threw exception: java.util.prefs.BackingStoreException: Couldn't get file lock.


test result: Failed. Execution failed: `main' threw exception: java.util.prefs.BackingStoreException: Couldn't get file lock.
======================================================================

Comments
EVALUATION All incidents indicate that the prefs locking fails when it's a combinaiion of a 32-bit linux NFS client and 64-bit NFS server, on JDK/JRE 1.4.x. This issue has been addressed in bug 4947349 for JDK1.5 and later (root cause is that linux kernel 2.2 does not support 64-bit flock, so JDK1.4.x, which is assumed to run on such linux kernel, is using flock instead of flock64). Closed as dup of 4947349. The FileChannel.lock() fails on HP-UX NFS server issue is being traced in #6628575.
13-11-2007

EVALUATION We will need to find out in details on which confugurations locking fails and why does it fail. We a planning to move to NIO locking in Mantis, but similar problems could arise there. ###@###.### 2002-05-07
07-05-2002