From 67b3e95477cda5ce69be015b8546b879984fb245 Mon Sep 17 00:00:00 2001 From: Kelly O'Hair Date: Mon, 12 Dec 2011 08:15:10 -0800 Subject: [PATCH 1/2] 7119829: Adjust default jprt testing configuration Reviewed-by: alanb --- corba/make/jprt.properties | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/corba/make/jprt.properties b/corba/make/jprt.properties index cb67b3c2d3a..360b6b22dba 100644 --- a/corba/make/jprt.properties +++ b/corba/make/jprt.properties @@ -25,21 +25,21 @@ # Properties for jprt -# The release to build +# Locked down to jdk8 jprt.tools.default.release=jdk8 # The different build flavors we want, we override here so we just get these 2 jprt.build.flavors=product,fastdebug # Standard list of jprt build targets for this source tree -jprt.build.targets= \ - solaris_sparc_5.10-{product|fastdebug}, \ - solaris_sparcv9_5.10-{product|fastdebug}, \ - solaris_i586_5.10-{product|fastdebug}, \ - solaris_x64_5.10-{product|fastdebug}, \ - linux_i586_2.6-{product|fastdebug}, \ - linux_x64_2.6-{product|fastdebug}, \ - windows_i586_5.1-{product|fastdebug}, \ +jprt.build.targets= \ + solaris_sparc_5.10-{product|fastdebug}, \ + solaris_sparcv9_5.10-{product|fastdebug}, \ + solaris_i586_5.10-{product|fastdebug}, \ + solaris_x64_5.10-{product|fastdebug}, \ + linux_i586_2.6-{product|fastdebug}, \ + linux_x64_2.6-{product|fastdebug}, \ + windows_i586_5.1-{product|fastdebug}, \ windows_x64_5.2-{product|fastdebug} # Directories to be excluded from the source bundles From 2829f07b30764fe077d6d4ec2ae8ad33d4ae29d0 Mon Sep 17 00:00:00 2001 From: Dmeetry Degrave Date: Sun, 18 Dec 2011 22:12:41 +0400 Subject: [PATCH 2/2] 7046238: new InitialContext(); hangs Synchronization on a single monitor for contactInfo parameters with identical hashCode() Reviewed-by: robm, skoppar --- .../CorbaClientRequestDispatcherImpl.java | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java index 7728a677ecd..1878596aca3 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/protocol/CorbaClientRequestDispatcherImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -113,6 +113,9 @@ import com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr; import com.sun.corba.se.impl.transport.CorbaContactInfoListIteratorImpl; import com.sun.corba.se.impl.util.JDKBridge; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.ConcurrentHashMap; + /** * ClientDelegate is the RMI client-side subcontract or representation * It implements RMI delegate as well as our internal ClientRequestDispatcher @@ -122,6 +125,9 @@ public class CorbaClientRequestDispatcherImpl implements ClientRequestDispatcher { + private ConcurrentMap locks = + new ConcurrentHashMap(); + public OutputObject beginRequest(Object self, String opName, boolean isOneWay, ContactInfo contactInfo) { @@ -148,8 +154,21 @@ public class CorbaClientRequestDispatcherImpl // This locking is done so that multiple connections are not created // for the same endpoint - //6929137 - Synchronized on contactInfo to avoid blocking across multiple endpoints - synchronized (contactInfo) { + // 7046238 - Synchronization on a single monitor for contactInfo parameters + // with identical hashCode(), so we lock on same monitor for equal parameters + // (which can refer to equal (in terms of equals()) but not the same objects) + + Object lock = locks.get(contactInfo); + + if (lock == null) { + Object newLock = new Object(); + lock = locks.putIfAbsent(contactInfo, newLock); + if (lock == null) { + lock = newLock; + } + } + + synchronized (lock) { if (contactInfo.isConnectionBased()) { if (contactInfo.shouldCacheConnection()) { connection = (CorbaConnection) @@ -254,7 +273,7 @@ public class CorbaClientRequestDispatcherImpl registerWaiter(messageMediator); // Do connection reclaim now - synchronized (contactInfo) { + synchronized (lock) { if (contactInfo.isConnectionBased()) { if (contactInfo.shouldCacheConnection()) { OutboundConnectionCache connectionCache =