JDK-2180208 : JNDI wake up when clock_settime() is called
  • Type: Backport
  • Backport of: JDK-6751923
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2009-07-17
  • Updated: 2011-04-23
  • Resolved: 2011-04-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other Other
5.0u23,hs20Fixed hs20Fixed
Description
See main CR - but basically if the system time changes (eg via ntp adjustments) the timed-poll() that underlies Thread.sleep can return immediately, with no error indicator, causing the Thread.sleep to return early. This can cause problems with tests that use Thread.sleep to delay until other threads should be in the right state.
Correction: as per 6474541 it takes more than just a simple time change to trigger this bug. But this simple fix remains worthwhile.

Comments
EVALUATION Confused. JDK7 is now on HS20... Is this fix-delivered in HS20? Is the fix actually the correct fix? If yes and yes, please ask the hs gatekeeper to mark this bug as fix-delivered.
08-12-2010

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-rt/hotspot/rev/22260322f0be
18-11-2010

EVALUATION The fix for this is not present in Hotspot 19 / JDK7. This patch contains the fix but appears to have been generated in the wrong direction: > * @(#)os_solaris.cpp 1.344 08/08/06 2677,2682c2677 < // See c/r 6751923. Poll can return 0 before time < // has elapsed if time is set via clock_settime (as NTP does). < // res == 0 if poll timed out (see man poll RETURN VALUES) < // using the logic below checks that we really did < // sleep at least "millis" if not we'll sleep again. < if( ( res == 0 ) || ((res == OS_ERR) && (errno == EINTR))) { --- > if((res == OS_ERR) && (errno == EINTR)) { Line 3388 in os_solaris.cpp should be: if( ( res == 0 ) || ((res == OS_ERR) && (errno == EINTR))) { when the fix is present.
18-11-2010

EVALUATION It appears that proposed changeset already in jdk7 tree. (os_solaris::os_sleep)
17-11-2010

EVALUATION Need forward-port of fix.
26-08-2010

SUGGESTED FIX See main CR
17-07-2009

EVALUATION While there are a number of outstanding issues with Thread.sleep on various platforms, the rework needed to address those issues seems unlikely to be addressed. However for this specific problem there is a very simple fix already implemented in the JDK5 update train.
17-07-2009