Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/90047


Change subject: mw-install-sqlite: avoid race condition
......................................................................

mw-install-sqlite: avoid race condition

By using $JOB_NAME, jobs run in parallel might well end up deleting the
tmpfs sqlite database from another run of the same job.  Instead use the
trailing part of the WORKSPACE for which Jenkins append @1, @2 as a
suffix.

Change-Id: I0ec838647d76f75da555b555977e56bfaa349485
---
M bin/mw-install-sqlite.sh
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/jenkins 
refs/changes/47/90047/1

diff --git a/bin/mw-install-sqlite.sh b/bin/mw-install-sqlite.sh
index 18ae586..24319af 100755
--- a/bin/mw-install-sqlite.sh
+++ b/bin/mw-install-sqlite.sh
@@ -2,7 +2,11 @@
 
 # We sometime have a tmpfs to use, that speeds up sqlite
 if [ -d "$HOME/tmpfs" ]; then
-       SQLITE_DIR="$HOME/tmpfs/$JOB_NAME"
+       # We can not use JOB_NAME has a job identifier since when running in
+       # parallel we will have a race condition. Instead use the trailing part 
of
+       # the WORKSPACE which would be 'foo', 'foo@1', 'foo@2'
+       # Trailing slash is important there.
+       SQLITE_DIR="$HOME/tmpfs/`basename $WORKSPACE`/"
        mkdir -p $SQLITE_DIR
 else
        SQLITE_DIR="$WORKSPACE/data"

-- 
To view, visit https://gerrit.wikimedia.org/r/90047
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0ec838647d76f75da555b555977e56bfaa349485
Gerrit-PatchSet: 1
Gerrit-Project: integration/jenkins
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to