You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by sn...@apache.org on 2015/03/30 21:58:36 UTC
[32/50] incubator-usergrid git commit: Merge branch 'USERGRID-405'
into USERGRID-448-appinfofix
Merge branch 'USERGRID-405' into USERGRID-448-appinfofix
Conflicts:
stack/test-utils/src/main/java/org/apache/usergrid/setup/ConcurrentProcessSingleton.java
Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/68f56dd2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/68f56dd2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/68f56dd2
Branch: refs/heads/two-dot-o-dev
Commit: 68f56dd26762afeacd84eebd8d608ff865354985
Parents: c8fcf2d 774324c
Author: Dave Johnson <dm...@apigee.com>
Authored: Fri Mar 20 09:49:49 2015 -0400
Committer: Dave Johnson <dm...@apigee.com>
Committed: Fri Mar 20 09:49:49 2015 -0400
----------------------------------------------------------------------
stack/pom.xml | 5 ++--
.../setup/ConcurrentProcessSingleton.java | 28 ++++++++++----------
2 files changed, 16 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/68f56dd2/stack/test-utils/src/main/java/org/apache/usergrid/setup/ConcurrentProcessSingleton.java
----------------------------------------------------------------------
diff --cc stack/test-utils/src/main/java/org/apache/usergrid/setup/ConcurrentProcessSingleton.java
index c5d9a71,63aa70d..d8e124f
--- a/stack/test-utils/src/main/java/org/apache/usergrid/setup/ConcurrentProcessSingleton.java
+++ b/stack/test-utils/src/main/java/org/apache/usergrid/setup/ConcurrentProcessSingleton.java
@@@ -38,11 -36,13 +38,12 @@@ import java.util.concurrent.TimeoutExce
*/
public class ConcurrentProcessSingleton {
+ private static final Logger logger = LoggerFactory.getLogger( ConcurrentProcessSingleton.class );
- private static final String TEMP_FILE_PATH =
- "target/surefirelocks/start_barrier-" + System.getProperty( "test.barrier.timestamp", "default" );
+ private static final String TEMP_FILE_PATH = "target/surefirelocks/start_barrier-"
+ + System.getProperty( "test.barrier.timestamp", "default" );
- public static final int LOCK_PORT = AvailablePortFinder.getNextAvailable();
- public static final int LOCK_PORT = Integer.parseInt(
- System.getProperty( "test.lock.port", "10101" ) );
++ public static final int LOCK_PORT = Integer.parseInt( System.getProperty( "test.lock.port", "10101" ) );
public static final boolean CLEAN_STORAGE =
Boolean.parseBoolean( System.getProperty( "test.clean.storage", "false" ) );
@@@ -101,22 -100,18 +101,24 @@@
logger.info("Populating database");
schemaManager.populateBaseData();
- //signal to other processes we've migrated, and they can proceed
+ // signal to other processes we've migrated, and they can proceed
barrier.proceed();
- }
+ logger.info( "Waiting for setup to complete" );
+ barrier.await( ONE_MINUTE );
+ logger.info( "Setup to complete" );
+
+ lock.maybeReleaseLock();
- logger.info( "Waiting for setup to complete" );
- barrier.await( ONE_MINUTE );
- logger.info( "Setup to complete" );
+ } else {
+ throw new RuntimeException( "Unable to initialize system: could not get lock."
+ +" Some other process must be binding to port " + LOCK_PORT );
+ }
+ // Commented out: Never release the lock, otherwise some other JVM may destroy the schema
+ // lock.maybeReleaseLock();
}
+
catch ( Exception e ) {
throw new RuntimeException( "Unable to initialize system", e );
}