This guide will show you how to collect and analyze lock issues to report with us.
Make sure that the following applies:
Prepare your environment:
Open $JOB_COUNT terminals and change into the $ROOT/$PROJECT_NAME-1 to $ROOT/$PROJECT_NAME-$JOB_COUNT directories. Now start each job in a build loop:
$ for build in $(eval echo {1..$BUILD_COUNT}); do \ # Only if dedicated rm -rf $LOCAL_REPO; \ $MAVEN_HOME/bin/mvn clean compile -T1C -B -DskipTests -Dmaven.repo.local=$LOCAL_REPO \ -Dorg.slf4j.simpleLogger.showThreadName=true -Dorg.slf4j.simpleLogger.showDateTime=true \ -Dorg.slf4j.simpleLogger.log.org.eclipse.aether=trace -l $LOCK_FACTORY-$NAME_MAPPER-$build.log \ # Adjust to your needs -Daether.connector.basic.threads=8 -Daether.metadataResolver.threads=8 \ # If downloads take longer consider to increase -Daether.syncContext.named.time=120 \ -Daether.syncContext.named.factory=$LOCK_FACTORY -Daether.syncContext.named.nameMapper=$NAME_MAPPER; \ done
Wait for all jobs to complete.
We now need to extract, transform and load the data (ETL) into a SQLite database.
Change back to the $ROOT directory and collect all log files with build failures:
$ BUILD_FAILURE_LIST=$(mktemp) $ grep -l -r "BUILD FAILURE" $PROJECT_NAME-* > $BUILD_FAILURE_LIST
Run extraction and transformation:
$ while read log_file; do \ grep -e Acquiring -e Releasing -e "Failed to acquire" $log_file | \ sed -e 's# \[#;[#g' -e 's#\] #];#' -e "s#^#$log_file;#" | \ sed 's#\[TRACE\];##'; \ done < $BUILD_FAILURE_LIST > $LOCK_FACTORY-$NAME_MAPPER-locks.txt
Load and process the data in SQLite:
$ SCRIPT=$(mktemp) $ cat > $SCRIPT <<EOT .read $SCHEMA_FILE .separator ; .import $LOCK_FACTORY-$NAME_MAPPER-locks.txt lock_history .read $CREATE_LOCK_EVENTS_FILE .read $CREATE_LOCK_WORKFLOWS_FILE .save $LOCK_FACTORY-$NAME_MAPPER-locks.db EOT $ sqlite3 -batch < $SCRIPT $ rm -f $SCRIPT